Skip to content

Commit

Permalink
fix: update test to use atomic store (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
eloparco authored Feb 15, 2023
1 parent 27fcb69 commit 74824ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/testsuite/thread_spawn-simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void __wasi_thread_start_C(int thread_id, int *start_arg)
{
shared_t *data = (shared_t *)start_arg;

data->th_ready = 1;
__atomic_store_n(&data->th_ready, 1, __ATOMIC_SEQ_CST);
__builtin_wasm_memory_atomic_notify(&data->th_ready, 1);

// so we can have all the threads alive at the same time
Expand All @@ -34,7 +34,7 @@ void __wasi_thread_start_C(int thread_id, int *start_arg)
data->value += 8;
data->tid = thread_id;

data->th_done = 1;
__atomic_store_n(&data->th_done, 1, __ATOMIC_SEQ_CST);
__builtin_wasm_memory_atomic_notify(&data->th_done, 1);
}

Expand All @@ -57,6 +57,7 @@ int main(int argc, char **argv)

for (i = 0; i < data_count; i++)
{
__atomic_store_n(&data[i].th_continue, 1, __ATOMIC_SEQ_CST);
__builtin_wasm_memory_atomic_notify(&data[i].th_continue, 1);
}

Expand Down

0 comments on commit 74824ba

Please sign in to comment.