2
0
mirror of https://github.com/boostorg/thread.git synced 2026-02-09 23:42:18 +00:00

recursive_try_mutex has both a scoped_lock and a scoped_try_lock

[SVN r34297]
This commit is contained in:
Anthony Williams
2006-06-13 21:08:02 +00:00
parent 29a1903c4b
commit 0d3f4a0b7c
2 changed files with 10 additions and 0 deletions

View File

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