2 # eosPThread.h : $Revision$
22 extern int __eosPThread__;
23 extern int __eosPThreadNum__;
29 typedef enum eosPThreadStatus {
30 eosPThreadStatusWaiting = 0,
31 eosPThreadStatusRunning = 1
34 typedef struct eosPThread {
35 pthread_t* th; /* [max] thread */
36 eosPThreadStatus* status; /* [max] thread status */
37 long* id; /* [max] thread ID indicated by count */
39 int max; /* maximum thread number working simultaneously. */
40 long count; /* count of created threads */
41 long latest; /* working thread ID which started latest */
42 long oldest; /* working thread ID which started oldest */
52 extern void eosPThreadInit (eosPThread* t, int max, int mode);
53 extern int eosPThreadCreateOnWaitingThread (eosPThread* t, void* (*start_routine)(void *), void * arg, int mode);
54 extern int eosPThreadCreate (eosPThread* t, int i, void* (*start_routine)(void *), void * arg, int mode);
55 extern void eosPThreadJoin (eosPThread* t, int i, int mode);
56 extern void eosPThreadJoinAll(eosPThread* t, int mode);
58 extern void eosPThreadMutexInit(eosPThread* t);
59 extern void eosPThreadMutexLock(eosPThread* t);
60 extern void eosPThreadMutexUnlock(eosPThread* t);
68 #endif /* EOS_PTHREAD_H */