1 #ifndef THREAD_H_INCLUDED
2 #define THREAD_H_INCLUDED
4 /*********************************************************************
6 *********************************************************************/
8 typedef struct abyss_thread TThread;
13 typedef void TThreadProc(void * const userHandleP);
14 typedef void TThreadDoneFn(void * const userHandleP);
17 ThreadCreate(TThread ** const threadPP,
18 void * const userHandle,
19 TThreadProc * const func,
20 TThreadDoneFn * const threadDone,
21 abyss_bool const useSigchld,
22 const char ** const errorP);
25 ThreadRun(TThread * const threadP);
28 ThreadStop(TThread * const threadP);
31 ThreadKill(TThread * threadP);
34 ThreadWaitAndRelease(TThread * const threadP);
37 ThreadExit(int const retValue);
40 ThreadRelease(TThread * const threadP);
46 ThreadUpdateStatus(TThread * const threadP);
50 ThreadHandleSigchld(pid_t const pid);
53 /*********************************************************************
55 *********************************************************************/
58 typedef HANDLE TMutex;
61 typedef pthread_mutex_t TMutex;
64 abyss_bool MutexCreate(TMutex *m);
65 abyss_bool MutexLock(TMutex *m);
66 abyss_bool MutexUnlock(TMutex *m);
67 abyss_bool MutexTryLock(TMutex *m);
68 void MutexFree(TMutex *m);