27 #ifndef __SW_SHARP_THREADH__
28 #define __SW_SHARP_THREADH__
34 #include <semaphore.h>
45 typedef CRITICAL_SECTION
Mutex;
154 extern void threadCreate(Thread* thread,
void* (*routine)(
void*),
void* args);
179 #endif // __SW_SHARP_THREADH__
void threadCurrent(Thread *thread)
Thread getter.
void threadJoin(Thread thread)
Waits for thread to finish.
int semaphoreValue(Semaphore *semaphore)
Sempahore value getter.
sem_t Semaphore
Semaphore type.
Definition: thread.h:65
void semaphoreWait(Semaphore *semaphore)
Decreses sempahore value or waits.
void semaphorePost(Semaphore *semaphore)
Increases sempahore value.
void semaphoreDelete(Semaphore *semaphore)
Semaphore destructor.
void mutexDelete(Mutex *mutex)
Mutex destructor.
void threadCancel(Thread thread)
Cancels the current thread.
void threadSleep(unsigned int ms)
Sleeps the current thread.
void semaphoreCreate(Semaphore *semaphore, unsigned int value)
Semaphore constructor.
pthread_mutex_t Mutex
Mutex type.
Definition: thread.h:60
void mutexUnlock(Mutex *mutex)
Unlocks the mutex.
void mutexLock(Mutex *mutex)
Locks the mutex.
void mutexCreate(Mutex *mutex)
Mutex constructor.
pthread_t Thread
Thread type.
Definition: thread.h:70
void threadCreate(Thread *thread, void *(*routine)(void *), void *args)
Thread constructor.