IBR-DTNSuite
0.8
|
00001 /* 00002 * ObjectLock.h 00003 * 00004 * Created on: 23.11.2010 00005 * Author: morgenro 00006 */ 00007 00008 #include <set> 00009 #include <ibrcommon/thread/Mutex.h> 00010 #include <ibrcommon/thread/Conditional.h> 00011 00012 #ifndef OBJECTLOCK_H_ 00013 #define OBJECTLOCK_H_ 00014 00015 namespace ibrcommon 00016 { 00017 class ObjectLock 00018 { 00019 public: 00020 ObjectLock(void *obj); 00021 virtual ~ObjectLock(); 00022 00023 protected: 00024 static ibrcommon::Conditional __cond; 00025 static std::set<void*> __locks; 00026 void *_obj; 00027 }; 00028 } 00029 00030 #endif /* OBJECTLOCK_H_ */