diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2010-04-21 22:07:04 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2010-04-21 22:07:04 +0000 |
| commit | 49058d80637096b65b198d4dce7fb98a1151d2b0 (patch) | |
| tree | 2d2c6d77130f2337015c66b62df2ec125d211320 /cpp/src/qpid/sys/windows | |
| parent | 26d81efa13c8878f4584a721a3f0ea72ce27775f (diff) | |
| download | qpid-python-49058d80637096b65b198d4dce7fb98a1151d2b0.tar.gz | |
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
Diffstat (limited to 'cpp/src/qpid/sys/windows')
| -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 */ |
