diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-17 14:21:09 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-17 14:21:09 -0700 |
| commit | b9e1d53d7ac4e8d19520e3063b194ee01f550198 (patch) | |
| tree | 9aad6b77f36c7f221f5d6b660e6522fc3cfaae02 /node/Mutex.hpp | |
| parent | ab0806a036485979d60015a22a8e8831b68643a2 (diff) | |
| download | infinitytier-b9e1d53d7ac4e8d19520e3063b194ee01f550198.tar.gz infinitytier-b9e1d53d7ac4e8d19520e3063b194ee01f550198.zip | |
Minor cleanup.
Diffstat (limited to 'node/Mutex.hpp')
| -rw-r--r-- | node/Mutex.hpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/node/Mutex.hpp b/node/Mutex.hpp index 6f1d3471..854f321a 100644 --- a/node/Mutex.hpp +++ b/node/Mutex.hpp @@ -41,7 +41,6 @@ class Mutex : NonCopyable {
public:
Mutex()
- throw()
{
pthread_mutex_init(&_mh,(const pthread_mutexattr_t *)0);
}
@@ -52,25 +51,21 @@ public: }
inline void lock()
- throw()
{
pthread_mutex_lock(&_mh);
}
inline void unlock()
- throw()
{
pthread_mutex_unlock(&_mh);
}
inline void lock() const
- throw()
{
(const_cast <Mutex *> (this))->lock();
}
inline void unlock() const
- throw()
{
(const_cast <Mutex *> (this))->unlock();
}
@@ -81,15 +76,13 @@ public: class Lock : NonCopyable
{
public:
- Lock(Mutex &m)
- throw() :
+ Lock(Mutex &m) :
_m(&m)
{
m.lock();
}
- Lock(const Mutex &m)
- throw() :
+ Lock(const Mutex &m) :
_m(const_cast<Mutex *>(&m))
{
_m->lock();
@@ -123,7 +116,6 @@ class Mutex : NonCopyable {
public:
Mutex()
- throw()
{
InitializeCriticalSection(&_cs);
}
@@ -134,25 +126,21 @@ public: }
inline void lock()
- throw()
{
EnterCriticalSection(&_cs);
}
inline void unlock()
- throw()
{
LeaveCriticalSection(&_cs);
}
inline void lock() const
- throw()
{
(const_cast <Mutex *> (this))->lock();
}
inline void unlock() const
- throw()
{
(const_cast <Mutex *> (this))->unlock();
}
@@ -160,15 +148,13 @@ public: class Lock : NonCopyable
{
public:
- Lock(Mutex &m)
- throw() :
+ Lock(Mutex &m) :
_m(&m)
{
m.lock();
}
- Lock(const Mutex &m)
- throw() :
+ Lock(const Mutex &m) :
_m(const_cast<Mutex *>(&m))
{
_m->lock();
|
