From: Mukund Sivaraman Date: Sun, 14 Oct 2012 16:46:41 +0000 (+0530) Subject: [2198] Add AlreadyLocked exception to Mutex::Locker X-Git-Tag: trac2402_base~28^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=666bfa9c7b6de4ee31e210d7f3e0f2f68704f2de;p=thirdparty%2Fkea.git [2198] Add AlreadyLocked exception to Mutex::Locker --- diff --git a/src/lib/util/threads/lock.h b/src/lib/util/threads/lock.h index 8426a1aa67..54e914c621 100644 --- a/src/lib/util/threads/lock.h +++ b/src/lib/util/threads/lock.h @@ -15,6 +15,7 @@ #ifndef B10_THREAD_LOCK_H #define B10_THREAD_LOCK_H +#include #include #include // for NULL. @@ -76,6 +77,14 @@ public: /// of function no matter by what means. class Locker : public 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.