summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil/Thread.h
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-11-29 01:18:03 +0000
committerMichi Henning <michi@zeroc.com>2002-11-29 01:18:03 +0000
commit404a9441f45ac9ca1ba39f04c7f8d1f9fc79de5b (patch)
tree12023d167f8ab1b161aaec017a206863f4888bbf /cpp/include/IceUtil/Thread.h
parentfixing potential deadlock with ObjectAdapter (diff)
downloadice-404a9441f45ac9ca1ba39f04c7f8d1f9fc79de5b.tar.bz2
ice-404a9441f45ac9ca1ba39f04c7f8d1f9fc79de5b.tar.xz
ice-404a9441f45ac9ca1ba39f04c7f8d1f9fc79de5b.zip
Added ThreadControl::detach().
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