Skip to content

Commit

Permalink
atomic indexing for messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vlazzarini committed Oct 12, 2017
1 parent 4b95ffe commit 6a21f0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Top/threadsafe.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void message_enqueue(CSOUND *csound, int32_t message, char *args, int argsiz) {
csound->msg_queue[wp].message = message;
memcpy(csound->msg_queue[wp].args, args, argsiz);
#ifdef HAVE_ATOMIC_BUILTIN
__atomic_store(&csound->msg_queue_wp, wp != API_MAX_QUEUE ? wp + 1 : 0,
__atomic_store_n(&csound->msg_queue_wp, wp != API_MAX_QUEUE ? wp + 1 : 0,
__ATOMIC_RELEASE);
#else
csound->msg_queue_wp = wp != API_MAX_QUEUE ? wp + 1 : 0;
Expand Down

0 comments on commit 6a21f0e

Please sign in to comment.