diff options
author | Marc Laukien <marc@zeroc.com> | 2004-11-05 22:38:37 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2004-11-05 22:38:37 +0000 |
commit | b424ac60271896aaa57072b2ea7736b10ea5f55b (patch) | |
tree | a519a9568872cef45d5f99b35380bd0efc26430a /cpp/src/IceUtil/Thread.cpp | |
parent | fix (diff) | |
download | ice-b424ac60271896aaa57072b2ea7736b10ea5f55b.tar.bz2 ice-b424ac60271896aaa57072b2ea7736b10ea5f55b.tar.xz ice-b424ac60271896aaa57072b2ea7736b10ea5f55b.zip |
thread id fix
Diffstat (limited to 'cpp/src/IceUtil/Thread.cpp')
-rw-r--r-- | cpp/src/IceUtil/Thread.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp index bf2d54ab141..2e760ec3e1f 100644 --- a/cpp/src/IceUtil/Thread.cpp +++ b/cpp/src/IceUtil/Thread.cpp @@ -29,11 +29,11 @@ IceUtil::ThreadControl::ThreadControl() } } -IceUtil::ThreadControl::ThreadControl(const HandleWrapperPtr& handle, unsigned int id) +IceUtil::ThreadControl::ThreadControl(const HandleWrapperPtr& handle, ThreadId id) { IceUtil::Mutex::Lock lock(_stateMutex); _handle = handle; - _id = GetCurrentThreadId(); + _id = id; } IceUtil::ThreadControl::ThreadControl(const ThreadControl& tc) @@ -238,7 +238,9 @@ IceUtil::Thread::start(size_t stackSize) // __incRef(); - _handle->handle = (HANDLE)_beginthreadex(0, stackSize, (unsigned int (__stdcall*)(void*))startHook, (LPVOID)this, 0, &_id); + _handle->handle = (HANDLE)_beginthreadex( + 0, stackSize, (unsigned int (__stdcall*)(void*))startHook, (LPVOID)this, 0, &_id); + if(_handle->handle == 0) { __decRef(); @@ -317,7 +319,7 @@ IceUtil::Thread::operator<(const Thread& rhs) const #else -IceUtil::ThreadControl::ThreadControl(pthread_t id) +IceUtil::ThreadControl::ThreadControl(ThreadId id) { IceUtil::Mutex::Lock lock(_stateMutex); _id = id; |