aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/bh/internal/thread_win.h7
-rw-r--r--include/bh/thread.h6
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 <windows.h>
#include <process.h>
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 <windows.h>
+#include <process.h>
+
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,