From b424ac60271896aaa57072b2ea7736b10ea5f55b Mon Sep 17 00:00:00 2001 From: Marc Laukien Date: Fri, 5 Nov 2004 22:38:37 +0000 Subject: thread id fix --- cpp/src/IceUtil/Thread.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cpp/src/IceUtil/Thread.cpp') 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; -- cgit v1.2.3