mirror of
https://github.com/Kbz-8/Pulse.git
synced 2026-01-11 15:33:34 +00:00
fences
This commit is contained in:
@@ -4,16 +4,32 @@
|
||||
|
||||
#include "PulseInternal.h"
|
||||
|
||||
#include <tinycthread.h>
|
||||
#ifndef PULSE_PLAT_WASM
|
||||
#include <tinycthread.h>
|
||||
|
||||
PulseThreadID PulseGetThreadID()
|
||||
{
|
||||
return (PulseThreadID)thrd_current();
|
||||
}
|
||||
PulseThreadID PulseGetThreadID()
|
||||
{
|
||||
return (PulseThreadID)thrd_current();
|
||||
}
|
||||
|
||||
void PulseSleep(int32_t ms)
|
||||
{
|
||||
if(ms <= 0)
|
||||
return;
|
||||
thrd_sleep(&(struct timespec){ .tv_sec = ms / 1000, .tv_nsec = (ms % 1000) * 1000000 }, PULSE_NULLPTR);
|
||||
}
|
||||
void PulseSleep(int32_t ms)
|
||||
{
|
||||
if(ms <= 0)
|
||||
return;
|
||||
thrd_sleep(&(struct timespec){ .tv_sec = ms / 1000, .tv_nsec = (ms % 1000) * 1000000 }, PULSE_NULLPTR);
|
||||
}
|
||||
#else
|
||||
#include <emscripten/threading.h>
|
||||
|
||||
PulseThreadID PulseGetThreadID()
|
||||
{
|
||||
return (PulseThreadID)0;
|
||||
}
|
||||
|
||||
void PulseSleep(int32_t ms)
|
||||
{
|
||||
if(ms <= 0)
|
||||
return;
|
||||
emscripten_thread_sleep(ms);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user