mirror of
https://github.com/janet-lang/janet
synced 2025-01-11 16:10:27 +00:00
Fix atomics - warnings on windows
This commit is contained in:
parent
ffd79c6097
commit
4ecadfabf4
@ -632,7 +632,11 @@ void janet_addtimeout(double sec) {
|
|||||||
|
|
||||||
void janet_ev_inc_refcount(void) {
|
void janet_ev_inc_refcount(void) {
|
||||||
#ifdef JANET_WINDOWS
|
#ifdef JANET_WINDOWS
|
||||||
|
#ifdef JANET_64
|
||||||
|
InterlockedIncrement64(&janet_vm.extra_listeners);
|
||||||
|
#else
|
||||||
InterlockedIncrement(&janet_vm.extra_listeners);
|
InterlockedIncrement(&janet_vm.extra_listeners);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
__atomic_add_fetch(&janet_vm.extra_listeners, 1, __ATOMIC_RELAXED);
|
__atomic_add_fetch(&janet_vm.extra_listeners, 1, __ATOMIC_RELAXED);
|
||||||
#endif
|
#endif
|
||||||
@ -640,7 +644,11 @@ void janet_ev_inc_refcount(void) {
|
|||||||
|
|
||||||
void janet_ev_dec_refcount(void) {
|
void janet_ev_dec_refcount(void) {
|
||||||
#ifdef JANET_WINDOWS
|
#ifdef JANET_WINDOWS
|
||||||
|
#ifdef JANET_64
|
||||||
|
InterlockedDecrement64(&janet_vm.extra_listeners);
|
||||||
|
#else
|
||||||
InterlockedDecrement(&janet_vm.extra_listeners);
|
InterlockedDecrement(&janet_vm.extra_listeners);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
__atomic_add_fetch(&janet_vm.extra_listeners, -1, __ATOMIC_RELAXED);
|
__atomic_add_fetch(&janet_vm.extra_listeners, -1, __ATOMIC_RELAXED);
|
||||||
#endif
|
#endif
|
||||||
@ -1377,7 +1385,7 @@ JanetFiber *janet_loop1(void) {
|
|||||||
} else if (sig == JANET_SIGNAL_OK || (task.fiber->flags & (1 << sig))) {
|
} else if (sig == JANET_SIGNAL_OK || (task.fiber->flags & (1 << sig))) {
|
||||||
JanetChannel *chan = janet_channel_unwrap(sv);
|
JanetChannel *chan = janet_channel_unwrap(sv);
|
||||||
janet_channel_push(chan, make_supervisor_event(janet_signal_names[sig],
|
janet_channel_push(chan, make_supervisor_event(janet_signal_names[sig],
|
||||||
task.fiber, chan->is_threaded), 2);
|
task.fiber, chan->is_threaded), 2);
|
||||||
} else if (!is_suspended) {
|
} else if (!is_suspended) {
|
||||||
janet_stacktrace_ext(task.fiber, res, "");
|
janet_stacktrace_ext(task.fiber, res, "");
|
||||||
}
|
}
|
||||||
|
@ -857,6 +857,7 @@ JANET_CORE_FN(os_sigaction,
|
|||||||
janet_sandbox_assert(JANET_SANDBOX_SIGNAL);
|
janet_sandbox_assert(JANET_SANDBOX_SIGNAL);
|
||||||
janet_arity(argc, 1, 3);
|
janet_arity(argc, 1, 3);
|
||||||
#ifdef JANET_WINDOWS
|
#ifdef JANET_WINDOWS
|
||||||
|
(void) argv;
|
||||||
janet_panic("unsupported on this platform");
|
janet_panic("unsupported on this platform");
|
||||||
#else
|
#else
|
||||||
/* TODO - per thread signal masks */
|
/* TODO - per thread signal masks */
|
||||||
|
Loading…
Reference in New Issue
Block a user