summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2006-02-01 15:45:52 +0000
committerBernard Normier <bernard@zeroc.com>2006-02-01 15:45:52 +0000
commit2712f0343ce5545a3c07f1686e3ffd53fa405612 (patch)
tree4968dc76a427ee4d877eae4002ad35000c30be8e /cpp
parentfix for bug 799 (diff)
downloadice-2712f0343ce5545a3c07f1686e3ffd53fa405612.tar.bz2
ice-2712f0343ce5545a3c07f1686e3ffd53fa405612.tar.xz
ice-2712f0343ce5545a3c07f1686e3ffd53fa405612.zip
added id() back
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/IceUtil/Thread.h10
-rw-r--r--cpp/src/IceUtil/Thread.cpp12
2 files changed, 22 insertions, 0 deletions
diff --git a/cpp/include/IceUtil/Thread.h b/cpp/include/IceUtil/Thread.h
index e1043183412..13830060c99 100644
--- a/cpp/include/IceUtil/Thread.h
+++ b/cpp/include/IceUtil/Thread.h
@@ -62,6 +62,16 @@ public:
//
void detach();
+ //
+ // id() returns the Thread ID on Windows and the underlying pthread_t
+ // on POSIX platforms.
+ //
+#ifdef _WIN32
+ DWORD id() const;
+#else
+ pthread_t id() const;
+#endif
+
static void sleep(const Time&);
static void yield();
diff --git a/cpp/src/IceUtil/Thread.cpp b/cpp/src/IceUtil/Thread.cpp
index 2fded2e8aa5..54f77f9fe37 100644
--- a/cpp/src/IceUtil/Thread.cpp
+++ b/cpp/src/IceUtil/Thread.cpp
@@ -120,6 +120,12 @@ IceUtil::ThreadControl::detach()
// is closed.
}
+DWORD
+IceUtil::ThreadControl::id() const
+{
+ return _id;
+}
+
void
IceUtil::ThreadControl::sleep(const Time& timeout)
@@ -352,6 +358,12 @@ IceUtil::ThreadControl::detach()
}
}
+pthread_t
+IceUtil::ThreadControl::id() const
+{
+ return _thread;;
+}
+
void
IceUtil::ThreadControl::sleep(const Time& timeout)
{