aboutsummaryrefslogtreecommitdiffstats
path: root/common/threads.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-26 20:34:16 -0800
committerChris Robinson <[email protected]>2018-11-26 20:34:16 -0800
commitbf9db1fe3d611137448c0eb99978c8906531ffc1 (patch)
tree8b63692a566aed2922b56126106c4e68412a0c79 /common/threads.h
parentecab90802a62266687cf8aeaa61dc2811ce191e7 (diff)
Remove althrd_t from Windows
Diffstat (limited to 'common/threads.h')
-rw-r--r--common/threads.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/common/threads.h b/common/threads.h
index 8fd1093d..a5f6ce45 100644
--- a/common/threads.h
+++ b/common/threads.h
@@ -30,14 +30,11 @@ enum {
almtx_recursive = 1,
};
-typedef int (*althrd_start_t)(void*);
-
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-typedef DWORD althrd_t;
typedef CRITICAL_SECTION almtx_t;
typedef HANDLE alsem_t;
@@ -81,6 +78,8 @@ typedef dispatch_semaphore_t alsem_t;
typedef sem_t alsem_t;
#endif /* __APPLE__ */
+typedef int (*althrd_start_t)(void*);
+
inline void althrd_yield(void)
{
@@ -102,12 +101,12 @@ inline int almtx_unlock(almtx_t *mtx)
return althrd_success;
}
-#endif
-
-
int althrd_create(althrd_t *thr, althrd_start_t func, void *arg);
int althrd_detach(althrd_t thr);
int althrd_join(althrd_t thr, int *res);
+
+#endif
+
void althrd_setname(const char *name);
int almtx_init(almtx_t *mtx, int type);