summaryrefslogtreecommitdiff
path: root/cppe/src/IceE/Cond.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2008-06-03 19:32:20 -0700
committerMark Spruiell <mes@zeroc.com>2008-06-03 19:32:20 -0700
commit3d649bed4328992f41f567136025f58a019a5159 (patch)
tree470be901fbbfe5c6cd4269884412b0d36b48dc92 /cppe/src/IceE/Cond.cpp
parentlocal interface fixes for slice2javae (diff)
downloadice-3d649bed4328992f41f567136025f58a019a5159.tar.bz2
ice-3d649bed4328992f41f567136025f58a019a5159.tar.xz
ice-3d649bed4328992f41f567136025f58a019a5159.zip
Various Ice-E fixes:
- Bug fix in slice2javae for local interfaces/classes - Added Ice.LocalObjectHolder - Reviewed Java/C++ demos and aligned with Ice - Source code clean up (removed tabs, etc.)
Diffstat (limited to 'cppe/src/IceE/Cond.cpp')
-rw-r--r--cppe/src/IceE/Cond.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/cppe/src/IceE/Cond.cpp b/cppe/src/IceE/Cond.cpp
index a761cb9f894..760cdd612d8 100644
--- a/cppe/src/IceE/Cond.cpp
+++ b/cppe/src/IceE/Cond.cpp
@@ -20,7 +20,7 @@ IceUtil::Semaphore::Semaphore(long initial)
_sem = CreateSemaphore(0, initial, 0x7fffffff, 0);
if(_sem == INVALID_HANDLE_VALUE)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -35,7 +35,7 @@ IceUtil::Semaphore::wait() const
int rc = WaitForSingleObject(_sem, INFINITE);
if(rc != WAIT_OBJECT_0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -47,7 +47,7 @@ IceUtil::Semaphore::timedWait(const Time& timeout) const
int rc = WaitForSingleObject(_sem, msec);
if(rc != WAIT_TIMEOUT && rc != WAIT_OBJECT_0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
return rc != WAIT_TIMEOUT;
}
@@ -58,7 +58,7 @@ IceUtil::Semaphore::post(int count) const
int rc = ReleaseSemaphore(_sem, count, 0);
if(rc == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -97,26 +97,26 @@ IceUtil::Cond::wake(bool broadcast)
if(_unblocked != 0)
{
- _blocked -= _unblocked;
- _unblocked = 0;
+ _blocked -= _unblocked;
+ _unblocked = 0;
}
if(_blocked > 0)
{
- //
- // Unblock some number of waiters.
- //
- _toUnblock = (broadcast) ? _blocked : 1;
- _internal.unlock();
- _queue.post();
+ //
+ // Unblock some number of waiters.
+ //
+ _toUnblock = (broadcast) ? _blocked : 1;
+ _internal.unlock();
+ _queue.post();
}
else
{
- //
- // Otherwise no blocked waiters, release gate & mutex.
- //
- _gate.post();
- _internal.unlock();
+ //
+ // Otherwise no blocked waiters, release gate & mutex.
+ //
+ _gate.post();
+ _internal.unlock();
}
}
@@ -136,26 +136,26 @@ IceUtil::Cond::postWait(bool timedOut) const
if(_toUnblock != 0)
{
- bool last = --_toUnblock == 0;
- _internal.unlock();
-
- if(timedOut)
- {
- _queue.wait();
- }
-
- if(last)
- {
- _gate.post();
- }
- else
- {
- _queue.post();
- }
+ bool last = --_toUnblock == 0;
+ _internal.unlock();
+
+ if(timedOut)
+ {
+ _queue.wait();
+ }
+
+ if(last)
+ {
+ _gate.post();
+ }
+ else
+ {
+ _queue.post();
+ }
}
else
{
- _internal.unlock();
+ _internal.unlock();
}
}
@@ -164,13 +164,13 @@ IceUtil::Cond::dowait() const
{
try
{
- _queue.wait();
- postWait(false);
+ _queue.wait();
+ postWait(false);
}
catch(...)
{
- postWait(false);
- throw;
+ postWait(false);
+ throw;
}
}
@@ -179,14 +179,14 @@ IceUtil::Cond::timedDowait(const Time& timeout) const
{
try
{
- bool rc = _queue.timedWait(timeout);
- postWait(!rc);
- return rc;
+ bool rc = _queue.timedWait(timeout);
+ postWait(!rc);
+ return rc;
}
catch(...)
{
- postWait(false);
- throw;
+ postWait(false);
+ throw;
}
}
@@ -201,19 +201,19 @@ IceUtil::Cond::Cond()
rc = pthread_condattr_init(&attr);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
rc = pthread_cond_init(&_cond, &attr);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
rc = pthread_condattr_destroy(&attr);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -230,7 +230,7 @@ IceUtil::Cond::signal()
int rc = pthread_cond_signal(&_cond);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -240,7 +240,7 @@ IceUtil::Cond::broadcast()
int rc = pthread_cond_broadcast(&_cond);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__, rc);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}