00001 #ifndef __J2K__RWLock_HPP__
00002 #define __J2K__RWLock_HPP__
00003
00004 #include <j2k/Fred/Standard.hpp>
00005 #include <j2k/nto/Mutex.hpp>
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 class RWLock {
00019 public:
00020 inline RWLock();
00021 inline virtual ~RWLock();
00022
00023 void read();
00024 void write();
00025
00026 void releaseRead();
00027 void releaseWrite();
00028
00029 private:
00030
00031
00032
00033
00034 long readers;
00035
00036 int readfail;
00037 int writefail;
00038 int loop;
00039
00040 Mutex mutex;
00041
00042
00043
00044 private:
00045
00046 inline RWLock( const RWLock& src );
00047
00048
00049 inline const RWLock& operator=( const RWLock& src );
00050 };
00051
00052 #include <j2k/nto/RWLock.inl>
00053
00054 #endif