summaryrefslogtreecommitdiff
path: root/cpp/src/IceUtil/Thread.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2003-04-16 04:24:18 +0000
committerBernard Normier <bernard@zeroc.com>2003-04-16 04:24:18 +0000
commit3c99b3b3923f419eb3c2934fb017dadea6180fc6 (patch)
treec61d296def71d4c261637ef1297706883bf17d94 /cpp/src/IceUtil/Thread.cpp
parenta link cost of 0 means accept all messages regardless of cost (diff)
downloadice-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/Thread.cpp')
-rw-r--r--cpp/src/IceUtil/Thread.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp
index d0f6407e12e..bb99ee54841 100644
--- a/cpp/src/IceUtil/Thread.cpp
+++ b/cpp/src/IceUtil/Thread.cpp
@@ -30,7 +30,7 @@ IceUtil::ThreadControl::ThreadControl()
int rc = DuplicateHandle(proc, current, proc, &_handle->handle, SYNCHRONIZE, TRUE, 0);
if(rc == 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__);
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -114,7 +114,7 @@ IceUtil::ThreadControl::join()
int rc = WaitForSingleObject(handle->handle, INFINITE);
if(rc != WAIT_OBJECT_0)
{
- throw ThreadSyscallException(__FILE__, __LINE__);
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
}
@@ -236,7 +236,7 @@ IceUtil::Thread::start()
if(_handle->handle == 0)
{
__decRef();
- throw ThreadSyscallException(__FILE__, __LINE__);
+ throw ThreadSyscallException(__FILE__, __LINE__, GetLastError());
}
_started = true;
@@ -384,7 +384,7 @@ IceUtil::ThreadControl::join()
int rc = pthread_join(id, &ignore);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -399,7 +399,7 @@ IceUtil::ThreadControl::detach()
int rc = pthread_detach(id);
if(rc != 0)
{
- throw ThreadSyscallException(__FILE__, __LINE__);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
}
@@ -475,6 +475,10 @@ startHook(void* arg)
cerr << "IceUtil::Thread::run(): uncaught exception: ";
cerr << e << endl;
}
+ catch(...)
+ {
+ cerr << "IceUtil::Thread::run(): uncaught exception" << endl;
+ }
return 0;
}
}
@@ -503,7 +507,7 @@ IceUtil::Thread::start()
if(rc != 0)
{
__decRef();
- throw ThreadSyscallException(__FILE__, __LINE__);
+ throw ThreadSyscallException(__FILE__, __LINE__, rc);
}
_started = true;