Implement TLS and spinlocks, fix bug in Windows threads

This commit is contained in:
2024-06-10 22:24:57 +03:00
parent 8939076f94
commit ada9d3ada5
10 changed files with 359 additions and 3 deletions

View File

@@ -367,6 +367,45 @@ int bh_thread_pool_init(bh_thread_pool_t *pool,
return BH_NO_IMPL;
}
void bh_spinlock_init(bh_spinlock_t *lock)
{
lock->handle = 0;
}
void bh_spinlock_destroy(bh_spinlock_t *lock)
{
(void)lock;
}
int bh_spinlock_lock(bh_spinlock_t *lock)
{
return BH_NO_IMPL;
}
int bh_spinlock_unlock(bh_spinlock_t *lock)
{
return BH_NO_IMPL;
}
int bh_spinlock_try_lock(bh_spinlock_t *lock)
{
return BH_NO_IMPL;
}
bh_tls_info_t *bh_tls_info(void)
{
static bh_tls_info_t info;
return &info;
}
bh_tls_t *bh_tls_fetch(void)
{
static bh_tls_t tls;
return &tls;
}
/**
* \}
*/