Add thread support
This commit is contained in:
30
include/bh/internal/thread_posix.h
Normal file
30
include/bh/internal/thread_posix.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <pthread.h>
|
||||
|
||||
struct bh_thread_s
|
||||
{
|
||||
pthread_t handle;
|
||||
};
|
||||
|
||||
struct bh_mutex_s
|
||||
{
|
||||
pthread_mutex_t handle;
|
||||
};
|
||||
|
||||
struct bh_cond_s
|
||||
{
|
||||
pthread_cond_t handle;
|
||||
};
|
||||
|
||||
int bh_thread_init(bh_thread_t *thread,
|
||||
bh_task_t *task);
|
||||
|
||||
int bh_mutex_init(bh_mutex_t *mutex);
|
||||
void bh_mutex_destroy(bh_mutex_t *mutex);
|
||||
|
||||
int bh_cond_init(bh_cond_t *cond);
|
||||
void bh_cond_destroy(bh_cond_t *cond);
|
||||
|
||||
int bh_thread_pool_init(bh_thread_pool_t *pool,
|
||||
size_t size);
|
||||
|
||||
void bh_thread_pool_destroy(bh_thread_pool_t *pool);
|
||||
Reference in New Issue
Block a user