bring inline with C11 atomics; no volatile and cas order of expected/desired

This commit is contained in:
daan 2020-07-25 22:52:27 -07:00
parent e27422adca
commit 09ade02429
12 changed files with 170 additions and 188 deletions

View file

@ -200,7 +200,7 @@ static bool os_random_buf(void* buf, size_t buf_len) {
#ifndef GRND_NONBLOCK
#define GRND_NONBLOCK (1)
#endif
static volatile _Atomic(uintptr_t) no_getrandom; // = 0
static _Atomic(uintptr_t) no_getrandom; // = 0
if (mi_atomic_read(&no_getrandom)==0) {
ssize_t ret = syscall(SYS_getrandom, buf, buf_len, GRND_NONBLOCK);
if (ret >= 0) return (buf_len == (size_t)ret);