aboutsummaryrefslogtreecommitdiff
path: root/dep/src/zthread/posix/FastLock.h
diff options
context:
space:
mode:
Diffstat (limited to 'dep/src/zthread/posix/FastLock.h')
-rw-r--r--dep/src/zthread/posix/FastLock.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/dep/src/zthread/posix/FastLock.h b/dep/src/zthread/posix/FastLock.h
index 87faf34d4ff..261fd7c893a 100644
--- a/dep/src/zthread/posix/FastLock.h
+++ b/dep/src/zthread/posix/FastLock.h
@@ -39,16 +39,16 @@ namespace ZThread {
*
* This is the smallest and fastest synchronization object in the library.
* It is an implementation of fast mutex, an all or nothing exclusive
- * lock. It should be used only where you need speed and are willing
+ * lock. It should be used only where you need speed and are willing
* to sacrifice all the state & safety checking provided by the framework
* for speed.
- */
+ */
class FastLock : private NonCopyable {
-
+
pthread_mutex_t _mtx;
public:
-
+
/**
* Create a new FastLock. No safety or state checks are performed.
*
@@ -60,7 +60,7 @@ class FastLock : private NonCopyable {
throw Initialization_Exception();
}
-
+
/**
* Destroy a FastLock. No safety or state checks are performed.
*/
@@ -71,14 +71,14 @@ class FastLock : private NonCopyable {
}
}
-
+
/**
* Acquire an exclusive lock. No safety or state checks are performed.
*
* @exception Synchronization_Exception - not thrown
*/
inline void acquire() {
-
+
if(pthread_mutex_lock(&_mtx) != 0)
throw Synchronization_Exception();
@@ -97,22 +97,22 @@ class FastLock : private NonCopyable {
return (pthread_mutex_trylock(&_mtx) == 0);
}
-
+
/**
* Release an exclusive lock. No safety or state checks are performed.
- * The caller should have already acquired the lock, and release it
+ * The caller should have already acquired the lock, and release it
* only once.
- *
+ *
* @exception Synchronization_Exception - not thrown
*/
inline void release() {
-
+
if(pthread_mutex_unlock(&_mtx) != 0)
throw Synchronization_Exception();
}
-
-
+
+
}; /* FastLock */