From bc1d198c10a77d6e37c46fb0b9e3cb4fcb7c5f38 Mon Sep 17 00:00:00 2001 From: Mikhail Romanko Date: Wed, 24 Apr 2024 00:17:36 +0300 Subject: Fix windows compilation issues --- include/bh/internal/thread_win.h | 7 ++++++- include/bh/thread.h | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/bh/internal/thread_win.h b/include/bh/internal/thread_win.h index a84cbdb..e2108bc 100644 --- a/include/bh/internal/thread_win.h +++ b/include/bh/internal/thread_win.h @@ -1,3 +1,4 @@ +#include #include struct bh_thread_s @@ -19,7 +20,11 @@ struct bh_mutex_s struct bh_cond_s { - void *handle; + CRITICAL_SECTION lock; + HANDLE wait; + HANDLE done; + int waiting; + int signals; }; int bh_thread_init_base(bh_thread_t *thread, diff --git a/include/bh/thread.h b/include/bh/thread.h index 45a0e6e..3ec037f 100644 --- a/include/bh/thread.h +++ b/include/bh/thread.h @@ -16,7 +16,11 @@ typedef struct bh_thread_pool_s bh_thread_pool_t; bh_thread_t *bh_thread_new(bh_task_t *task); bh_thread_pool_t *bh_thread_pool_new(size_t size); + #elif defined(BHLIB_USE_WINTHREAD) +#include +#include + typedef uintptr_t (__cdecl *bh_thread_begin_cb_t)(void *, unsigned, unsigned (__stdcall *)(void *), @@ -24,7 +28,7 @@ typedef uintptr_t (__cdecl *bh_thread_begin_cb_t)(void *, unsigned, unsigned *); -typedef uintptr_t (__cdecl *bh_thread_end_cb_t)(unsigned); +typedef void (__cdecl *bh_thread_end_cb_t)(unsigned); bh_thread_t *bh_thread_new_base(bh_task_t *task, bh_thread_begin_cb_t begin, -- cgit v1.2.3