7 #ifndef __platform_thread_h__ 8 #define __platform_thread_h__ 43 typedef void* (FE_CDECL ThreadDefaultInitFunction)(
void);
44 typedef void* (FE_CDECL ThreadInitFunction)(
void* a_pFunctor);
45 typedef bool (FE_CDECL ThreadConfigFunction)(
void* a_pRawThread,String a_property,String a_value);
46 typedef void (FE_CDECL ThreadInterruptFunction)(
void* a_pRawThread);
47 typedef void (FE_CDECL ThreadJoinFunction)(
void* a_pRawThread);
48 typedef bool (FE_CDECL ThreadJoinableFunction)(
void* a_pRawThread);
49 typedef void (FE_CDECL ThreadFinishFunction)(
void* a_pRawThread);
50 typedef void (FE_CDECL ThreadInterruptionFunction)(void);
51 typedef int (FE_CDECL ThreadConcurrencyFunction)(void);
53 typedef void* (FE_CDECL ThreadGroupInitFunction)(
void);
54 typedef void* (FE_CDECL ThreadGroupCreateFunction)(
55 void* a_pRawThreadGroup,
void* a_pFunctor);
56 typedef void (FE_CDECL ThreadGroupJoinAllFunction)(
void* a_pRawThreadGroup);
57 typedef void (FE_CDECL ThreadGroupFinishFunction)(
void* a_pRawThreadGroup);
61 FE_MEM_PORT
extern ThreadDefaultInitFunction* gs_fnThreadDefaultInit;
62 FE_MEM_PORT
extern ThreadInitFunction* gs_fnThreadInit;
63 FE_MEM_PORT
extern ThreadConfigFunction* gs_fnThreadConfig;
64 FE_MEM_PORT
extern ThreadInterruptFunction* gs_fnThreadInterrupt;
65 FE_MEM_PORT
extern ThreadJoinFunction* gs_fnThreadJoin;
66 FE_MEM_PORT
extern ThreadJoinableFunction* gs_fnThreadJoinable;
67 FE_MEM_PORT
extern ThreadFinishFunction* gs_fnThreadFinish;
68 FE_MEM_PORT
extern ThreadInterruptionFunction* gs_fnThreadInterruption;
69 FE_MEM_PORT
extern ThreadConcurrencyFunction* gs_fnThreadConcurrency;
71 FE_MEM_PORT
extern ThreadGroupInitFunction* gs_fnThreadGroupInit;
72 FE_MEM_PORT
extern ThreadGroupCreateFunction* gs_fnThreadGroupCreate;
73 FE_MEM_PORT
extern ThreadGroupJoinAllFunction* gs_fnThreadGroupJoinAll;
74 FE_MEM_PORT
extern ThreadGroupFinishFunction* gs_fnThreadGroupFinish;
76 FE_MEM_PORT
extern String gs_threadSupport;
77 FE_MEM_PORT
extern BWORD gs_threadChecked;
78 FE_MEM_PORT
extern DL_Loader* gs_pThreadLoader;
80 class FE_DL_PUBLIC FE_DL_EXPORT Thread
84 class FE_DL_PUBLIC FE_DL_EXPORT Functor
88 virtual ~Functor(
void);
89 virtual void operate(
void);
91 void operator()(
void);
97 class FE_DL_PUBLIC FE_DL_EXPORT Group
103 Thread* createThread(Functor* a_pFunctor);
108 void* m_pRawThreadGroup;
112 Thread(Functor* a_pFunctor);
113 Thread(
void* a_pRawThread);
116 BWORD config(String a_property,String a_value);
117 BWORD interrupt(
void);
119 BWORD joinable(
void);
121 static BWORD interruptionPoint(
void);
122 static I32 hardwareConcurrency(
void);
123 static String support(
void) {
return gs_threadSupport; }
125 static void replaceDefaultInitFunction(
126 ThreadDefaultInitFunction* a_fnDefaultInit)
127 { gs_fnThreadDefaultInit=a_fnDefaultInit; }
128 static void replaceInitFunction(
129 ThreadInitFunction* a_fnInit)
130 { gs_fnThreadInit=a_fnInit; }
131 static void replaceConfigFunction(
132 ThreadConfigFunction* a_fnConfig)
133 { gs_fnThreadConfig=a_fnConfig; }
134 static void replaceInterruptFunction(
135 ThreadInterruptFunction* a_fnInterrupt)
136 { gs_fnThreadInterrupt=a_fnInterrupt; }
137 static void replaceJoinFunction(
138 ThreadJoinFunction* a_fnJoin)
139 { gs_fnThreadJoin=a_fnJoin; }
140 static void replaceJoinableFunction(
141 ThreadJoinableFunction* a_fnJoinable)
142 { gs_fnThreadJoinable=a_fnJoinable; }
143 static void replaceFinishFunction(
144 ThreadFinishFunction* a_fnFinish)
145 { gs_fnThreadFinish=a_fnFinish; }
146 static void replaceInterruptionFunction(
147 ThreadInterruptionFunction* a_fnInterruption)
148 { gs_fnThreadInterruption=a_fnInterruption; }
149 static void replaceConcurrencyFunction(
150 ThreadConcurrencyFunction* a_fnConcurrency)
151 { gs_fnThreadConcurrency=a_fnConcurrency; }
153 static void replaceGroupInitFunction(
154 ThreadGroupInitFunction* a_fnGroupInit)
155 { gs_fnThreadGroupInit=a_fnGroupInit; }
156 static void replaceGroupCreateFunction(
157 ThreadGroupCreateFunction* a_fnGroupCreate)
158 { gs_fnThreadGroupCreate=a_fnGroupCreate; }
159 static void replaceGroupJoinAllFunction(
160 ThreadGroupJoinAllFunction* a_fnGroupJoinAll)
161 { gs_fnThreadGroupJoinAll=a_fnGroupJoinAll; }
162 static void replaceGroupFinishFunction(
163 ThreadGroupFinishFunction* a_fnGroupFinish)
164 { gs_fnThreadGroupFinish=a_fnGroupFinish; }
166 static BWORD clearFunctionPointers(
void);
167 static BWORD dismiss(
void);
171 static BWORD confirm(
void);
kernel
Definition: namespace.dox:3