summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil/StaticMutex.h
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
committerBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
commitabada90e3f84dc703b8ddc9efcbed8a946fadead (patch)
tree2c6f9dccd510ea97cb927a7bd635422efaae547a /cpp/include/IceUtil/StaticMutex.h
parentremoving trace message (diff)
downloadice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip
Expanded tabs into spaces
Diffstat (limited to 'cpp/include/IceUtil/StaticMutex.h')
-rw-r--r--cpp/include/IceUtil/StaticMutex.h78
1 files changed, 39 insertions, 39 deletions
diff --git a/cpp/include/IceUtil/StaticMutex.h b/cpp/include/IceUtil/StaticMutex.h
index bf67e79635e..4bf6ccf2fad 100644
--- a/cpp/include/IceUtil/StaticMutex.h
+++ b/cpp/include/IceUtil/StaticMutex.h
@@ -95,7 +95,7 @@ private:
#else
struct LockState
{
- pthread_mutex_t* mutex;
+ pthread_mutex_t* mutex;
};
#endif
@@ -149,7 +149,7 @@ StaticMutex::lock() const
{
if(!initialized())
{
- initialize();
+ initialize();
}
EnterCriticalSection(_mutex);
assert(_mutex->RecursionCount == 1);
@@ -160,16 +160,16 @@ StaticMutex::tryLock() const
{
if(!initialized())
{
- initialize();
+ initialize();
}
if(!TryEnterCriticalSection(_mutex))
{
- return false;
+ return false;
}
if(_mutex->RecursionCount > 1)
{
- LeaveCriticalSection(_mutex);
- throw ThreadLockedException(__FILE__, __LINE__);
+ LeaveCriticalSection(_mutex);
+ throw ThreadLockedException(__FILE__, __LINE__);
}
return true;
}
@@ -195,7 +195,7 @@ StaticMutex::lock(LockState&) const
{
if(!initialized())
{
- initialize();
+ initialize();
}
EnterCriticalSection(_mutex);
}
@@ -207,20 +207,20 @@ StaticMutex::lock() const
{
if(!initialized())
{
- initialize();
+ initialize();
}
DWORD rc = WaitForSingleObject(_mutex, INFINITE);
if(rc != WAIT_OBJECT_0)
{
- if(rc == WAIT_FAILED)
- {
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
- }
- else
- {
- throw ThreadSyscallException(__FILE__, __LINE__, 0);
- }
+ if(rc == WAIT_FAILED)
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ }
+ else
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, 0);
+ }
}
_recursionCount++;
assert(_recursionCount == 1);
@@ -231,24 +231,24 @@ StaticMutex::tryLock() const
{
if(!initialized())
{
- initialize();
+ initialize();
}
DWORD rc = WaitForSingleObject(_mutex, 0);
if(rc != WAIT_OBJECT_0)
{
- return false;
+ return false;
}
else if(_recursionCount == 1)
{
- _recursionCount++;
- unlock();
- throw ThreadLockedException(__FILE__, __LINE__);
+ _recursionCount++;
+ unlock();
+ throw ThreadLockedException(__FILE__, __LINE__);
}
else
{
- _recursionCount++;
- return true;
+ _recursionCount++;
+ return true;
}
}
@@ -259,7 +259,7 @@ StaticMutex::unlock() const
BOOL rc = ReleaseMutex(_mutex);
if(rc == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -286,13 +286,13 @@ StaticMutex::lock() const
if(rc != 0)
{
if(rc == EDEADLK)
- {
- throw ThreadLockedException(__FILE__, __LINE__);
- }
- else
- {
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
- }
+ {
+ throw ThreadLockedException(__FILE__, __LINE__);
+ }
+ else
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ }
}
}
@@ -303,13 +303,13 @@ StaticMutex::tryLock() const
if(rc != 0 && rc != EBUSY)
{
if(rc == EDEADLK)
- {
- throw ThreadLockedException(__FILE__, __LINE__);
- }
- else
- {
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
- }
+ {
+ throw ThreadLockedException(__FILE__, __LINE__);
+ }
+ else
+ {
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ }
}
return (rc == 0);
}
@@ -320,7 +320,7 @@ StaticMutex::unlock() const
int rc = pthread_mutex_unlock(&_mutex);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}