/*!
  \file
  \brief ロックガード

  \author Satofumi KAMIMURA

  $Id: LockGuard.cpp 1811 2010-04-30 16:12:05Z satofumi $
*/

#include "LockGuard.h"
#include "Lock.h"

using namespace qrk;


struct LockGuard::pImpl
{
    Lock& mutex_;


    pImpl(Lock& mutex) : mutex_(mutex)
    {
        mutex_.lock();
    }


    ~pImpl(void)
    {
        mutex_.unlock();
    }
};


LockGuard::LockGuard(Lock& mutex) : pimpl(new pImpl(mutex))
{
}


LockGuard::~LockGuard(void)
{
}
