Make all atomic operations explicit
Some checks failed
CI / build:rt (pull_request) Failing after 23s
CI / build:debug (pull_request) Successful in 23s
CI / build:nompi (pull_request) Successful in 26s
CI / build:asan (pull_request) Failing after 31s
CI / build:local (pull_request) Successful in 1m18s
CI / build:compilers (pull_request) Successful in 38s

This commit is contained in:
Rodrigo Arias 2024-10-15 12:33:52 +02:00
parent cdc5b9b866
commit 148aaa71a1

View File

@ -180,7 +180,7 @@ ovni_add_cpu(int index, int phyid)
if (phyid < 0) if (phyid < 0)
die("cannot use negative CPU id %d", phyid); die("cannot use negative CPU id %d", phyid);
if (rproc.st != ST_READY) if (atomic_load(&rproc.st) != ST_READY)
die("process not ready"); die("process not ready");
if (!rthread.ready) if (!rthread.ready)
@ -199,7 +199,7 @@ ovni_add_cpu(int index, int phyid)
void void
ovni_proc_set_rank(int rank, int nranks) ovni_proc_set_rank(int rank, int nranks)
{ {
if (rproc.st != ST_READY) if (atomic_load(&rproc.st) != ST_READY)
die("process not ready"); die("process not ready");
if (!rthread.ready) if (!rthread.ready)
@ -273,7 +273,7 @@ ovni_proc_init(int app, const char *loom, int pid)
create_proc_dir(loom, pid); create_proc_dir(loom, pid);
rproc.st = ST_READY; atomic_store(&rproc.st, ST_READY);
} }
static int static int
@ -535,7 +535,7 @@ ovni_thread_init(pid_t tid)
if (tid == 0) if (tid == 0)
die("cannot use tid=%d", tid); die("cannot use tid=%d", tid);
if (rproc.st != ST_READY) if (atomic_load(&rproc.st) != ST_READY)
die("process not ready"); die("process not ready");
memset(&rthread, 0, sizeof(rthread)); memset(&rthread, 0, sizeof(rthread));
@ -770,7 +770,7 @@ ovni_flush(void)
if (!rthread.ready) if (!rthread.ready)
die("thread is not initialized"); die("thread is not initialized");
if (rproc.st != ST_READY) if (atomic_load(&rproc.st) != ST_READY)
die("process not ready"); die("process not ready");
ovni_ev_set_clock(&pre, ovni_clock_now()); ovni_ev_set_clock(&pre, ovni_clock_now());