From 49058d80637096b65b198d4dce7fb98a1151d2b0 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Wed, 21 Apr 2010 22:07:04 +0000 Subject: QPID-2527: Remove Thread::id member as its uses are better implemented by comparison operators. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@936537 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/windows/Thread.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/sys/windows') 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 */ -- cgit v1.2.1