diff options
| author | Mikhail Romanko <me@blankhex.com> | 2024-04-14 22:32:58 +0300 |
|---|---|---|
| committer | Mikhail Romanko <me@blankhex.com> | 2024-04-14 22:32:58 +0300 |
| commit | a645a201d85c37c81b11432acc73f48c9068846a (patch) | |
| tree | 7c85a42996bcc61493b1650fa2445b38c64125ef /include/bh/internal/thread_posix.h | |
| parent | d6c396231f7cca7f8fffd3d7bd67dc8ba2fba122 (diff) | |
| download | bhlib-old-a645a201d85c37c81b11432acc73f48c9068846a.tar.gz | |
Add thread support
Diffstat (limited to 'include/bh/internal/thread_posix.h')
| -rw-r--r-- | include/bh/internal/thread_posix.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/bh/internal/thread_posix.h b/include/bh/internal/thread_posix.h new file mode 100644 index 0000000..311d0ae --- /dev/null +++ b/include/bh/internal/thread_posix.h @@ -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);
\ No newline at end of file |
