aboutsummaryrefslogtreecommitdiff
path: root/dep/include/sockets/Thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'dep/include/sockets/Thread.h')
-rw-r--r--dep/include/sockets/Thread.h54
1 files changed, 27 insertions, 27 deletions
diff --git a/dep/include/sockets/Thread.h b/dep/include/sockets/Thread.h
index d784a1594f6..4e99664d579 100644
--- a/dep/include/sockets/Thread.h
+++ b/dep/include/sockets/Thread.h
@@ -1,6 +1,6 @@
/** \file Thread.h
- ** \date 2004-10-30
- ** \author grymse@alhem.net
+ ** \date 2004-10-30
+ ** \author grymse@alhem.net
**/
/*
Copyright (C) 2004-2007 Anders Hedstrom
@@ -8,7 +8,7 @@ Copyright (C) 2004-2007 Anders Hedstrom
This library is made available under the terms of the GNU GPL.
If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
+a separate license agreement is available. For information about
the closed-source license agreement for the C++ sockets library,
please visit http://www.alhem.net/Sockets/license.html and/or
email license@alhem.net.
@@ -52,43 +52,43 @@ typedef void * threadparam_t;
#endif
/** \defgroup threading Threading */
-/** Thread base class.
-The Thread class is used by the resolver (ResolvServer) and running a detached socket (SocketThread).
-When you know some processing will take a long time and will freeze up a socket, there is always the
+/** Thread base class.
+The Thread class is used by the resolver (ResolvServer) and running a detached socket (SocketThread).
+When you know some processing will take a long time and will freeze up a socket, there is always the
possibility to call Detach() on that socket before starting the processing.
When the OnDetached() callback is later called the processing can continue, now in its own thread.
- \ingroup threading */
+ \ingroup threading */
class Thread
{
public:
- Thread(bool release = true);
- virtual ~Thread();
+ Thread(bool release = true);
+ virtual ~Thread();
- static threadfunc_t STDPREFIX StartThread(threadparam_t);
+ static threadfunc_t STDPREFIX StartThread(threadparam_t);
- virtual void Run() = 0;
+ virtual void Run() = 0;
- bool IsRunning();
- void SetRunning(bool x);
- bool IsReleased();
- void SetRelease(bool x);
- bool DeleteOnExit();
- void SetDeleteOnExit(bool x = true);
- bool IsDestructor();
+ bool IsRunning();
+ void SetRunning(bool x);
+ bool IsReleased();
+ void SetRelease(bool x);
+ bool DeleteOnExit();
+ void SetDeleteOnExit(bool x = true);
+ bool IsDestructor();
private:
- Thread(const Thread& ) {}
- Thread& operator=(const Thread& ) { return *this; }
+ Thread(const Thread& ) {}
+ Thread& operator=(const Thread& ) { return *this; }
#ifdef _WIN32
- HANDLE m_thread;
- unsigned m_dwThreadId;
+ HANDLE m_thread;
+ unsigned m_dwThreadId;
#else
- pthread_t m_thread;
+ pthread_t m_thread;
#endif
- bool m_running;
- bool m_release;
- bool m_b_delete_on_exit;
- bool m_b_destructor;
+ bool m_running;
+ bool m_release;
+ bool m_b_delete_on_exit;
+ bool m_b_destructor;
};