42 #ifndef _DWMPTHREADLOCKER_HH_ 43 #define _DWMPTHREADLOCKER_HH_ 53 typedef std::map<const char *, std::pair<uint32_t,Mutex> > LockerMutexMap;
54 extern Mutex g_LockerMutex;
55 extern LockerMutexMap g_LockerMutexes;
69 _obj = (
const char *)obj;
71 LockerMutexMap::iterator iter = g_LockerMutexes.find(_obj);
72 if (iter == g_LockerMutexes.end()) {
73 g_LockerMutexes[_obj].first = 1;
78 g_LockerMutex.Unlock();
87 LockerMutexMap::iterator iter = g_LockerMutexes.find(_obj);
88 if (iter != g_LockerMutexes.end()) {
90 if (! iter->second.first) {
91 g_LockerMutexes.erase(iter);
94 g_LockerMutex.Unlock();
103 g_LockerMutex.Lock();
104 LockerMutexMap::iterator iter = g_LockerMutexes.find(_obj);
105 if (iter != g_LockerMutexes.end()) {
106 rc = iter->second.second.Lock();
108 g_LockerMutex.Unlock();
118 g_LockerMutex.Lock();
119 LockerMutexMap::iterator iter = g_LockerMutexes.find(_obj);
120 if (iter != g_LockerMutexes.end()) {
121 rc = iter->second.second.Unlock();
123 g_LockerMutex.Unlock();
135 #endif // _DWMPTHREADLOCKER_HH_ Dwm::Pthread::Mutex class definition.
Definition: DwmBZ2IO.hh:67