aboutsummaryrefslogtreecommitdiff
path: root/src/shared/Threading.h
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-17 15:35:07 -0700
committermaximius <none@none>2009-10-17 15:35:07 -0700
commit26b5e033ffde3d161382fc9addbfa99738379641 (patch)
treea344f369ca32945f787a02dee35c3dbe342bed7e /src/shared/Threading.h
parentf21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff)
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
Diffstat (limited to 'src/shared/Threading.h')
-rw-r--r--src/shared/Threading.h19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/shared/Threading.h b/src/shared/Threading.h
index 574b9641aac..36d35ff9f79 100644
--- a/src/shared/Threading.h
+++ b/src/shared/Threading.h
@@ -15,24 +15,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
#ifndef THREADING_H
#define THREADING_H
-
#include <ace/Thread.h>
#include <ace/TSS_T.h>
#include "ace/Atomic_Op.h"
#include <assert.h>
-
namespace ACE_Based
{
-
class Runnable
{
public:
virtual ~Runnable() {}
virtual void run() = 0;
-
void incReference() { ++m_refs; }
void decReference()
{
@@ -42,7 +37,6 @@ namespace ACE_Based
private:
ACE_Atomic_Op<ACE_Thread_Mutex, int> m_refs;
};
-
enum Priority
{
Idle,
@@ -53,56 +47,43 @@ namespace ACE_Based
Highest,
Realtime,
};
-
#define MAXPRIORITYNUM (Realtime + 1)
-
class ThreadPriority
{
public:
ThreadPriority();
int getPriority(Priority p) const;
-
private:
int m_priority[MAXPRIORITYNUM];
};
-
class Thread
{
public:
Thread();
explicit Thread(Runnable* instance);
~Thread();
-
bool start();
bool wait();
void destroy();
-
void suspend();
void resume();
-
void setPriority(Priority type);
-
static void Sleep(unsigned long msecs);
static ACE_thread_t currentId();
static ACE_hthread_t currentHandle();
static Thread * current();
-
private:
Thread(const Thread&);
Thread& operator=(const Thread&);
-
static ACE_THR_FUNC_RETURN ThreadTask(void * param);
-
ACE_thread_t m_iThreadId;
ACE_hthread_t m_hThreadHandle;
Runnable * m_task;
-
typedef ACE_TSS<Thread> ThreadStorage;
//global object - container for Thread class representation of every thread
static ThreadStorage m_ThreadStorage;
//use this object to determine current OS thread priority values mapped to enum Priority{}
static ThreadPriority m_TpEnum;
};
-
}
#endif