aboutsummaryrefslogtreecommitdiff
path: root/dep/src/zthread/posix/FastLock.h
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-12 17:09:15 -0600
committermegamage <none@none>2009-02-12 17:09:15 -0600
commit6aee5fcbe7473a3cbac12b7e8482a7b98bef8be3 (patch)
tree91ec91d5c19eba9c2fe0e84b1c9dc7047a3de80e /dep/src/zthread/posix/FastLock.h
parent2d2f433b4de1c35b22aaf07854fc0ee11fcb350d (diff)
parentf385747164c3fb278c92ef46fbd6c3da6590bbf0 (diff)
*Merge.
--HG-- branch : trunk
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 */