medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 9c2b43f332cff4e4807f3bb2d352acdea2d828d1
parent f9b0431908aed740a5cd35988aba5424111060bf
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat Sep 10 18:12:10 -0700

Don't use seqcst in WorkQueue

Diffstat:
work_queue.cc | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/work_queue.cc b/work_queue.cc @@ -15,11 +15,11 @@ struct ThreadInfo { }; static bool workqueue_step( u32 thread_id, WorkQueue * queue ) { - u32 current_head = load_seqcst( &queue->head ); + u32 current_head = load_relaxed( &queue->head ); u32 new_head = current_head + 1; - if( current_head != load_seqcst( &queue->tail ) ) { - if( compare_exchange_seqcst( &queue->head, &current_head, new_head ) ) { + if( current_head != load_acquire( &queue->tail ) ) { + if( compare_exchange_acqrel( &queue->head, &current_head, new_head ) ) { const Job & job = queue->jobs[ current_head % array_count( queue->jobs ) ]; job.callback( job.data, &queue->arenas[ thread_id ] ); }