All Classes Namespaces Files Functions Variables Enumerations Enumerator
libs/system/LockGuard.cpp
Go to the documentation of this file.
00001 
00010 #include "LockGuard.h"
00011 #include "Lock.h"
00012 
00013 using namespace qrk;
00014 
00015 
00016 struct LockGuard::pImpl
00017 {
00018     Lock& mutex_;
00019 
00020 
00021     pImpl(Lock& mutex) : mutex_(mutex)
00022     {
00023         mutex_.lock();
00024     }
00025 
00026 
00027     ~pImpl(void)
00028     {
00029         mutex_.unlock();
00030     }
00031 };
00032 
00033 
00034 LockGuard::LockGuard(Lock& mutex) : pimpl(new pImpl(mutex))
00035 {
00036 }
00037 
00038 
00039 LockGuard::~LockGuard(void)
00040 {
00041 }