diff options
Diffstat (limited to 'cpp/src/qpid/sys/windows/Thread.cpp')
| -rwxr-xr-x | cpp/src/qpid/sys/windows/Thread.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cpp/src/qpid/sys/windows/Thread.cpp b/cpp/src/qpid/sys/windows/Thread.cpp index fed82e4d54..583a9613a3 100755 --- a/cpp/src/qpid/sys/windows/Thread.cpp +++ b/cpp/src/qpid/sys/windows/Thread.cpp @@ -65,6 +65,18 @@ Thread::Thread(Runnable* runnable) : impl(new ThreadPrivate(runnable)) {} Thread::Thread(Runnable& runnable) : impl(new ThreadPrivate(&runnable)) {} +Thread::operator bool() { + return impl; +} + +bool Thread::operator==(const Thread& t) const { + return impl->threadId == t.impl->threadId; +} + +bool Thread::operator!=(const Thread& t) const { + return !(*this==t); +} + void Thread::join() { if (impl) { DWORD status = WaitForSingleObject (impl->threadHandle, INFINITE); @@ -74,8 +86,8 @@ void Thread::join() { } } -unsigned long Thread::id() { - return impl ? impl->threadId : 0; +unsigned long Thread::logId() { + return GetCurrentThreadId(); } /* static */ |
