Update flecs stdcpp threading api
parent
7d5c519e2f
commit
ff9f483da1
|
@ -5,6 +5,10 @@
|
|||
|
||||
#include "flecs/flecs.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
static
|
||||
ecs_os_thread_t stdcpp_thread_new(
|
||||
ecs_os_thread_callback_t callback,
|
||||
|
@ -32,8 +36,8 @@ int32_t stdcpp_ainc(int32_t *count) {
|
|||
value = __sync_add_and_fetch (count, 1);
|
||||
return value;
|
||||
#else
|
||||
/* Unsupported */
|
||||
abort();
|
||||
(void)value;
|
||||
return InterlockedIncrement(reinterpret_cast<long*>(count));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -44,8 +48,8 @@ int32_t stdcpp_adec(int32_t *count) {
|
|||
value = __sync_sub_and_fetch (count, 1);
|
||||
return value;
|
||||
#else
|
||||
/* Unsupported */
|
||||
abort();
|
||||
(void)value;
|
||||
return InterlockedDecrement(reinterpret_cast<long*>(count));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue