summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil/Thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/include/IceUtil/Thread.h')
-rw-r--r--cpp/include/IceUtil/Thread.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cpp/include/IceUtil/Thread.h b/cpp/include/IceUtil/Thread.h
index f9d954dee95..b7ffea27c9e 100644
--- a/cpp/include/IceUtil/Thread.h
+++ b/cpp/include/IceUtil/Thread.h
@@ -73,6 +73,14 @@ public:
//
void join();
+ //
+ // Detach a thread. Once a thread is detached, it cannot be detached
+ // again, nor can it be joined with. Every thread must either be
+ // joined with or detached exactly once. Failing to do so results
+ // in resource leaks.
+ //
+ void detach();
+
static void sleep(const Time&);
static void yield();
@@ -81,6 +89,7 @@ private:
#ifdef _WIN32
HandleWrapperPtr _handle;
unsigned _id;
+ bool _detached;
#else
pthread_t _id;
#endif