Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
1b638d68
Commit
1b638d68
authored
Oct 22, 2012
by
Mukund Sivaraman
Browse files
[2198] Add AlreadyLocked exception to Mutex::Locker
parent
638f92b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/util/threads/sync.h
View file @
1b638d68
...
...
@@ -15,6 +15,8 @@
#ifndef B10_THREAD_SYNC_H
#define B10_THREAD_SYNC_H
#include <exceptions/exceptions.h>
#include <boost/noncopyable.hpp>
#include <cstdlib> // for NULL.
...
...
@@ -77,6 +79,14 @@ public:
/// of function no matter by what means.
class
Locker
:
boost
::
noncopyable
{
public:
/// \brief Exception thrown when the mutex is already locked and
/// a non-blocking locker is attempted around it.
struct
AlreadyLocked
:
public
isc
::
InvalidParameter
{
AlreadyLocked
(
const
char
*
file
,
size_t
line
,
const
char
*
what
)
:
isc
::
InvalidParameter
(
file
,
line
,
what
)
{}
};
/// \brief Constructor.
///
/// Locks the mutex. May block for extended period of time.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment