#include "Thread/ScopedLock.hh"

namespace LilWrapper
{
  ScopedLock::ScopedLock(Mutex *mutex)
    : _mutex(mutex)
  {
    this->_mutex->lock();
  }

  ScopedLock::~ScopedLock()
  {
    this->_mutex->unlock();
  }
}

#include "Thread/ScopedLock.hh"

namespace LilWrapper
{
  ScopedLock::ScopedLock(Mutex *mutex)
    : _mutex(mutex)
  {
    if (this->_mutex)
      this->_mutex->lock();
  }

  ScopedLock::~ScopedLock()
  {
    if (this->_mutex)
      this->_mutex->unlock();
  }
}

Make sure the Mutex exists before using it.
Make sure the Mutex exists before using it.
