|
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 00018 #ifndef ANDROMETA_M_GUARD_H 00019 #define ANDROMETA_M_GUARD_H 00020 00021 namespace Meta{ 00022 00023 class MMutex; 00024 00034 class MGuard{ 00035 public: 00036 00042 MGuard(MMutex& mutex); 00043 00049 MGuard(MMutex* mutex); 00050 00054 ~MGuard(); 00055 00059 void release(); 00060 00064 void acquire(); 00065 00071 bool tryAcquire(); 00072 00073 private: 00074 MGuard(const MGuard&); 00075 MGuard& operator=(const MGuard&); 00076 00077 class MGuard_* x_; 00078 }; 00079 00080 } // end namespace Meta 00081 00082 #endif // ANDROMETA_M_GUARD_H
1.7.6.1