diff options
author | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-12 17:09:15 -0600 |
commit | 6aee5fcbe7473a3cbac12b7e8482a7b98bef8be3 (patch) | |
tree | 91ec91d5c19eba9c2fe0e84b1c9dc7047a3de80e /dep/src/zthread/win32/FastLock.h | |
parent | 2d2f433b4de1c35b22aaf07854fc0ee11fcb350d (diff) | |
parent | f385747164c3fb278c92ef46fbd6c3da6590bbf0 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'dep/src/zthread/win32/FastLock.h')
-rw-r--r-- | dep/src/zthread/win32/FastLock.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/dep/src/zthread/win32/FastLock.h b/dep/src/zthread/win32/FastLock.h index 2e9fe829af6..3b212e1d891 100644 --- a/dep/src/zthread/win32/FastLock.h +++ b/dep/src/zthread/win32/FastLock.h @@ -39,10 +39,10 @@ namespace ZThread { * @version 2.2.11 * * This FastLock implementation is based on a Win32 Mutex - * object. This will perform better under high contention, + * object. This will perform better under high contention, * but will not be as fast as the spin lock under reasonable * circumstances. - */ + */ class FastLock : private NonCopyable { HANDLE _hMutex; @@ -51,11 +51,11 @@ namespace ZThread { #endif public: - + /** * Create a new FastLock */ - FastLock() { + FastLock() { #ifndef NDEBUG _locked = false; @@ -68,11 +68,11 @@ namespace ZThread { } - + ~FastLock() { ::CloseHandle(_hMutex); } - + void acquire() { if(::WaitForSingleObject(_hMutex, INFINITE) != WAIT_OBJECT_0) { @@ -113,7 +113,7 @@ namespace ZThread { switch(::WaitForSingleObject(_hMutex, timeout)) { case WAIT_OBJECT_0: - + #ifndef NDEBUG // Simulate deadlock to provide consistent behavior. This @@ -122,7 +122,7 @@ namespace ZThread { while(_locked) ThreadOps::yield(); - + _locked = true; #endif |