5 #define G_THREAD_DATA_SIZE ( sizeof(void*)+sizeof(unsigned int) )
6 #define G_THREAD_NAME_MAX_SIZE 32
7 #define G_THREAD_CURRENT_PROCESS 0
14 enum GSchedulePolicy_t
24 G_EXC_DEFINE(WrongThreadRecreateException,MultithreadException);
26 G_EXC_DEFINE(ThreadAlreadyCreatedException,MultithreadException);
27 G_EXC_DEFINE(DestructingStillExistingThread,MultithreadException);
28 G_EXC_DEFINE(KillingNotAttachedThread,MultithreadException);
29 G_EXC_DEFINE(InvalidSchedulePolicy,MultithreadException);
30 G_EXC_DEFINE(JoiningANotAttachedThread,MultithreadException);
32 typedef void* (*GthreadEntryPointPf_t) (
void* );
41 G_COPY_CONSTRUCTOR_PROHIBITED(
Thread);
48 virtual void cancel ( );
49 virtual void* join ( );
50 virtual const void* detach ( );
52 GInt64_t getId ( )
const {
return mId; }
53 const char* getThreadName ( )
const {
return mThreadName; }
54 bool isAttached ( )
const {
return mIsAttached; }
55 void* getData ( ) {
return mData; }
57 #if defined(WIN32) && G_OPTION_HIDE_INCOMPATIBLE == 0
58 void* getWindowsHandle ( );
61 void winTerminate ( GInt32_t exit_code );
64 static GInt32_t get_MaxPriority ( GSchedulePolicy_t = sched_other );
65 static GInt32_t get_MinPriority ( GSchedulePolicy_t = sched_other );
67 static GSchedulePolicy_t get_ProcessSchedulePolicy ( GInt32_t pid = G_THREAD_CURRENT_PROCESS );
68 static void set_ProcessSchedulePolicy ( GSchedulePolicy_t , GInt32_t pid = G_THREAD_CURRENT_PROCESS );
70 GInt32_t getPriority ( );
71 void setPriority ( GInt32_t priority );
73 static void do_Sleep (
double sleep_secs );
74 static GInt64_t get_CurrentThreadId ( );
76 static void do_CurrentThreadExit (
void* exit_value );
81 virtual void mAttach (
const void* aData );
88 void mSetThreadName (
const char* aName );
89 void mSetThreadNameAsCurrentThreadName ( );
91 static void m_ResetCurrentThreadName ( );
93 char mThreadName [G_THREAD_NAME_MAX_SIZE+1];
94 char mData [G_THREAD_DATA_SIZE];
100 #include "g_mthread_ThreadSelf.h"
Definition: g_mthread_ThreadSelf.h:10
#define G_EXC_DEFINE(aexctypename, abaseexctypename)
Definition: g_exception_macros.h:39
Definition: g.mthread.ThreadSimpleEvent.h:5
Definition: g_mthread_Thread.h:36
Definition: g_mthread_ThreadAbstract.h:18