diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/CHANGES | 4 | ||||
-rw-r--r-- | cpp/config/TestUtil.py | 4 | ||||
-rw-r--r-- | cpp/include/IceUtil/Thread.h | 4 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 1 | ||||
-rw-r--r-- | cpp/src/IceUtil/Thread.cpp | 10 |
5 files changed, 15 insertions, 8 deletions
diff --git a/cpp/CHANGES b/cpp/CHANGES index 8a21742fc8c..67d5a6924d9 100644 --- a/cpp/CHANGES +++ b/cpp/CHANGES @@ -1,6 +1,10 @@ Changes since version 1.5.1 --------------------------- +- For WIN32, Thread::getThreadControl() set the thread id of the + ThreadControl object to the current thread instead of the thread the + control object belongs to. This has been fixed. + - Changed Ice::Service to use _exit() in the daemon parent. - Fixed a bug with AMD exception handling, where it was possible that diff --git a/cpp/config/TestUtil.py b/cpp/config/TestUtil.py index 1d687e49e60..cdd1d550eac 100644 --- a/cpp/config/TestUtil.py +++ b/cpp/config/TestUtil.py @@ -29,8 +29,8 @@ compress = 1 # thread per connection mode. # -threadPerConnection = 0 -#threadPerConnection = 1 +#threadPerConnection = 0 +threadPerConnection = 1 # # If you don't set "host" below, then the Ice library will try to find diff --git a/cpp/include/IceUtil/Thread.h b/cpp/include/IceUtil/Thread.h index f13965a56f1..5b9356fc237 100644 --- a/cpp/include/IceUtil/Thread.h +++ b/cpp/include/IceUtil/Thread.h @@ -56,9 +56,9 @@ public: ThreadControl(); #ifdef _WIN32 - ThreadControl(const HandleWrapperPtr&, unsigned int); + ThreadControl(const HandleWrapperPtr&, ThreadId); #else - ThreadControl(pthread_t); + ThreadControl(ThreadId); #endif ThreadControl(const ThreadControl&); diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index 58608b74b95..f6ccd511f03 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -285,6 +285,7 @@ IceInternal::OutgoingConnectionFactory::create(const vector<EndpointPtr>& endpts assert(transceiver); } connection = new ConnectionI(_instance, transceiver, endpoint, 0); + cout << "yyy " << IceUtil::ThreadControl().id() << endl; connection->validate(); if(_instance->defaultsAndOverrides()->overrideCompress) 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; |