00001 00004 #ifndef _PHIL_H 00005 #define _PHIL_H 00006 00007 00008 00009 00014 typedef void * (*PhilRunnable)(void *); 00015 00019 typedef struct PhilThreadDesc* PhilThread; 00035 extern PhilThread PhilThreadCreate(int type, int priority, int stacksize, PhilRunnable start_routine, void * arg); 00036 00050 extern int PhilThreadJoin(PhilThread th, void **return_val); 00051 00058 extern void PhilThreadExit(void *return_val); 00059 00065 extern PhilThread PhilThreadCurrent(); 00066 00067 00075 extern void PhilThreadYield(); 00076 00082 typedef struct PhilMutex 00083 { 00084 /* à définir */ 00085 } PhilMutex; 00086 00087 00094 extern int PhilMutexInit( PhilMutex* verrou); 00095 00108 extern int PhilMutexDestroy(PhilMutex* verrou); 00109 00110 00123 extern int PhilMutexLock(PhilMutex* verrou); 00124 00136 extern int PhilMutexTryLock(PhilMutex* verrou); 00137 00150 extern int PhilMutexUnlock(PhilMutex* verrou); 00151 00152 00158 typedef struct PhilCond 00159 { 00160 /* à définir */ 00161 } PhilCond; 00162 00163 00172 extern int PhilCondInit(PhilCond* cond); 00173 00174 00188 extern int PhilCondDestroy(PhilCond* cond); 00189 00190 00204 extern int PhilCondSignal(PhilCond* cond); 00205 00219 extern int PhilCondBroadcast(PhilCond* cond); 00220 00234 extern int PhilCondWait(PhilCond* cond, PhilMutex* mutex); 00249 extern int PhilCondTimedWait(PhilCond* cond, PhilMutex* mutex, long int us); 00250 00251 00261 extern long int PhilNow(); 00262 00263 00271 extern int PhilInitialize( ); 00272 00273 00283 extern int PhilTerminate(); 00284 00292 extern void PhilAbort(char* mess); 00293 #endif