Implement WinNT condition variables, add semaphors
This commit is contained in:
20
src/thread.c
20
src/thread.c
@@ -68,6 +68,26 @@ void bh_mutex_free(bh_mutex_t *mutex)
|
||||
free(mutex);
|
||||
}
|
||||
|
||||
bh_semaphore_t *bh_semaphore_new(int count)
|
||||
{
|
||||
bh_semaphore_t *result;
|
||||
|
||||
result = malloc(sizeof(*result));
|
||||
if (result && bh_semaphore_init(result, count))
|
||||
{
|
||||
free(result);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void bh_semaphore_free(bh_semaphore_t *semaphore)
|
||||
{
|
||||
bh_semaphore_destroy(semaphore);
|
||||
free(semaphore);
|
||||
}
|
||||
|
||||
bh_cond_t *bh_cond_new(void)
|
||||
{
|
||||
bh_cond_t *result;
|
||||
|
||||
Reference in New Issue
Block a user