10 #define THREAD_DEFINED 1
17 #include "ThreadMutex.h"
20 typedef void *(*ThreadFunc
)(void*);
22 enum ThreadReturnCode_
27 typedef enum ThreadReturnCode_ ThreadReturnCode
;
29 typedef struct Thread_ Thread
;
45 // --- class functions
46 ThreadReturnCode
Thread_Init(void);
47 void Thread_Shutdown(void);
48 Thread
* Thread_CurrentThread(void);
49 ThreadReturnCode
Thread_WaitOnThread_(Thread
*other
);
50 List
* Thread_Threads(void);
53 Thread
* Thread_new(void);
54 Thread
* Thread_newWithFunc_arg_(ThreadFunc func
, void *funcArg
);
57 void Thread_destroy(Thread
* self
);
59 // --- member functions
60 // -- getter functions
61 ThreadFunc
Thread_func(Thread
*self
);
62 void * Thread_funcArg(Thread
*self
);
63 void * Thread_userData(Thread
*self
);
65 // -- setter functions
66 void Thread_setFunc_(Thread
*self
, ThreadFunc func
);
67 void Thread_setFuncArg_(Thread
*self
, void *funcArg
);
68 void Thread_setFunc_arg_(Thread
*self
, ThreadFunc
, void *funcArg
);
69 void Thread_setUserData_(Thread
*self
, void *userData
);
71 // -- operational functions
72 ThreadReturnCode
Thread_start(Thread
*self
);
73 ThreadReturnCode
Thread_stop(Thread
*self
);
74 void Thread_exitWithValue_(Thread
*self
, void *returnValue
);