|
AndroMeta
2.0.0
|
00001 /* 00002 * Copyright 2009-2012 AndroMeta LLC. All rights reserved. 00003 * 00004 * AndroMeta LLC retains all intellectual property and proprietary 00005 * rights to this software and related documentation and any modifications 00006 * thereto. Any use, reproduction, disclosure, or distribution of this 00007 * software and related documentation without an express license agreement 00008 * from AndroMeta LLC is strictly prohibited. 00009 * 00010 */ 00011 00019 #ifndef ANDROMETA_M_READ_GUARD_H 00020 #define ANDROMETA_M_READ_GUARD_H 00021 00022 #include <AndroMeta/MRWMutex.h> 00023 00024 namespace Meta{ 00025 00033 class MReadGuard{ 00034 public: 00035 MReadGuard(MRWMutex& mutex); 00036 00037 MReadGuard(MRWMutex* mutex); 00038 00039 ~MReadGuard(); 00040 00041 void release(); 00042 00043 void acquire(); 00044 00045 bool tryAcquire(); 00046 00047 private: 00048 MReadGuard& operator=(const MReadGuard&); 00049 MReadGuard(const MReadGuard&); 00050 00051 class MReadGuard_* x_; 00052 }; 00053 00054 } // end namespace Meta 00055 00056 #endif // ANDROMETA_M_READ_GUARD_H
1.7.6.1