diff options
author | Bernard Normier <bernard@zeroc.com> | 2003-04-16 04:24:18 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2003-04-16 04:24:18 +0000 |
commit | 3c99b3b3923f419eb3c2934fb017dadea6180fc6 (patch) | |
tree | c61d296def71d4c261637ef1297706883bf17d94 /cpp/src/IceUtil/Cond.cpp | |
parent | a link cost of 0 means accept all messages regardless of cost (diff) | |
download | ice-3c99b3b3923f419eb3c2934fb017dadea6180fc6.tar.bz2 ice-3c99b3b3923f419eb3c2934fb017dadea6180fc6.tar.xz ice-3c99b3b3923f419eb3c2934fb017dadea6180fc6.zip |
Mutex and Lock changes: lock/unlock now return void, trylock returns a bool
that indicates whether the lock was acquired or not, plus new member
functions on LockT/TryLockT
Diffstat (limited to 'cpp/src/IceUtil/Cond.cpp')
-rw-r--r-- | cpp/src/IceUtil/Cond.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/cpp/src/IceUtil/Cond.cpp b/cpp/src/IceUtil/Cond.cpp index 29b76783186..a6b6a84da25 100644 --- a/cpp/src/IceUtil/Cond.cpp +++ b/cpp/src/IceUtil/Cond.cpp @@ -25,7 +25,7 @@ IceUtil::Semaphore::Semaphore(long initial) _sem = CreateSemaphore(0, initial, 0x7fffffff, 0); if(_sem == INVALID_HANDLE_VALUE) { - throw ThreadSyscallException(__FILE__, __LINE__); + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } } @@ -40,7 +40,7 @@ IceUtil::Semaphore::wait() const int rc = WaitForSingleObject(_sem, INFINITE); if(rc != WAIT_OBJECT_0) { - throw ThreadSyscallException(__FILE__, __LINE__); + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } } @@ -53,7 +53,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__); + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } return rc != WAIT_TIMEOUT; } @@ -64,7 +64,7 @@ IceUtil::Semaphore::post(int count) const int rc = ReleaseSemaphore(_sem, count, 0); if(rc == 0) { - throw ThreadSyscallException(__FILE__, __LINE__); + throw ThreadSyscallException(__FILE__, __LINE__, GetLastError()); } } @@ -207,19 +207,19 @@ IceUtil::Cond::Cond() rc = pthread_condattr_init(&attr); if(rc != 0) { - throw ThreadSyscallException(__FILE__, __LINE__); + throw ThreadSyscallException(__FILE__, __LINE__, rc); } rc = pthread_cond_init(&_cond, &attr); if(rc != 0) { - throw ThreadSyscallException(__FILE__, __LINE__); + throw ThreadSyscallException(__FILE__, __LINE__, rc); } rc = pthread_condattr_destroy(&attr); if(rc != 0) { - throw ThreadSyscallException(__FILE__, __LINE__); + throw ThreadSyscallException(__FILE__, __LINE__, rc); } } @@ -236,7 +236,7 @@ IceUtil::Cond::signal() int rc = pthread_cond_signal(&_cond); if(rc != 0) { - throw ThreadSyscallException(__FILE__, __LINE__); + throw ThreadSyscallException(__FILE__, __LINE__, rc); } } @@ -246,7 +246,7 @@ IceUtil::Cond::broadcast() int rc = pthread_cond_broadcast(&_cond); if(rc != 0) { - throw ThreadSyscallException(__FILE__, __LINE__); + throw ThreadSyscallException(__FILE__, __LINE__, rc); } } |