2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-17 02:02:08 +00:00

timed_mutex and recursive_timed_mutex have scoped_locks

[SVN r34298]
This commit is contained in:
Anthony Williams
2006-06-14 07:31:13 +00:00
parent 0d3f4a0b7c
commit 01f93931cb
3 changed files with 18 additions and 0 deletions

View File

@@ -231,6 +231,10 @@ namespace boost
void lock()
{
if(locked())
{
throw boost::lock_error();
}
m.lock();
is_locked=true;
}
@@ -247,6 +251,10 @@ namespace boost
void unlock()
{
if(!locked())
{
throw boost::lock_error();
}
m.unlock();
is_locked=false;
}

View File

@@ -211,6 +211,10 @@ namespace boost
void lock()
{
if(locked())
{
throw boost::lock_error();
}
m.lock();
is_locked=true;
}
@@ -227,6 +231,10 @@ namespace boost
void unlock()
{
if(!locked())
{
throw boost::lock_error();
}
m.unlock();
is_locked=false;
}