30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#ifndef OF_MORPHOS
extern void OFTLSKeyThreadExited(void);
#endif
static OFTLSKey threadKey;
OF_CONSTRUCTOR()
{
OF_ENSURE(OFTLSKeyNew(&threadKey) == 0);
}
static void
functionWrapper(void)
{
bool detached = false;
OFPlainThread thread =
(OFPlainThread)((struct Process *)FindTask(NULL))->pr_ExitData;
OF_ENSURE(OFTLSKeySet(threadKey, thread) == 0);
thread->function(thread->object);
ObtainSemaphore(&thread->semaphore);
@try {
thread->done = true;
|
|
|
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#ifndef OF_MORPHOS
extern void OFTLSKeyThreadExited(void);
#endif
static OFTLSKey threadKey;
OF_CONSTRUCTOR()
{
OFEnsure(OFTLSKeyNew(&threadKey) == 0);
}
static void
functionWrapper(void)
{
bool detached = false;
OFPlainThread thread =
(OFPlainThread)((struct Process *)FindTask(NULL))->pr_ExitData;
OFEnsure(OFTLSKeySet(threadKey, thread) == 0);
thread->function(thread->object);
ObtainSemaphore(&thread->semaphore);
@try {
thread->done = true;
|