Commit 1b638d68 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2198] Add AlreadyLocked exception to Mutex::Locker

parent 638f92b8
......@@ -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.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment