Implement WinNT condition variables, add semaphors

This commit is contained in:
2024-04-27 11:25:21 +03:00
parent bc1d198c10
commit fdbabab0e0
11 changed files with 515 additions and 52 deletions

View File

@@ -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;