00001 #ifndef MUTEXLOCK_H_
00002 #define MUTEXLOCK_H_
00003
00004 #include "config.h"
00005
00006 #include "Mutex.h"
00007
00008 #ifdef HAVE_LIBCOMMONCPP
00009 #include <cc++/thread.h>
00010 #endif
00011
00012 namespace dtn
00013 {
00014 namespace utils
00015 {
00016 #ifdef HAVE_LIBCOMMONCPP
00017 class MutexLock : public ost::MutexLock
00018 {
00019 public:
00020 MutexLock(dtn::Mutex &m);
00021 ~MutexLock();
00022 };
00023 #else
00024 class MutexLock
00025 {
00026 public:
00027 MutexLock(Mutex &m);
00028 ~MutexLock();
00029
00030 void unlock();
00031
00032 private:
00033 Mutex &m_mutex;
00034 bool m_locked;
00035 };
00036 #endif
00037 }
00038 };
00039
00040 #endif