summaryrefslogtreecommitdiff
path: root/cpp/include/IceUtil/Thread.h
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2005-07-11 19:08:33 +0000
committerMatthew Newhook <matthew@zeroc.com>2005-07-11 19:08:33 +0000
commit1025594a09085e291116ed4560a3225168b52f94 (patch)
tree8f07385464cbe3f373ded143fa09d66c092e72c2 /cpp/include/IceUtil/Thread.h
parenthttp://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=397 (diff)
downloadice-1025594a09085e291116ed4560a3225168b52f94.tar.bz2
ice-1025594a09085e291116ed4560a3225168b52f94.tar.xz
ice-1025594a09085e291116ed4560a3225168b52f94.zip
merged in HandleWrapper fix from IceE.
Diffstat (limited to 'cpp/include/IceUtil/Thread.h')
-rw-r--r--cpp/include/IceUtil/Thread.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/include/IceUtil/Thread.h b/cpp/include/IceUtil/Thread.h
index b6ce5496474..03f0304aba5 100644
--- a/cpp/include/IceUtil/Thread.h
+++ b/cpp/include/IceUtil/Thread.h
@@ -23,21 +23,22 @@ class Time;
struct HandleWrapper : public Shared
{
// Inline for performance reasons.
- HandleWrapper(HANDLE h) :
- handle(h)
+ HandleWrapper(HANDLE h, bool r = true) :
+ handle(h), release(r)
{
}
// Inline for performance reasons.
virtual ~HandleWrapper()
{
- if(handle)
+ if(handle && release)
{
CloseHandle(handle);
}
}
HANDLE handle;
+ bool release;
};
typedef Handle<HandleWrapper> HandleWrapperPtr;