File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -795,7 +795,10 @@ void post_process_threaded_collisions() {
795795 for (auto & [i, processed] : workerThreads) {
796796 auto & thread = collision_thread_data_buffer[i];
797797
798- if (thread.result_length .load (std::memory_order_acquire) > processed) {
798+ size_t queue_length = thread.queue_length .load (std::memory_order_acquire);
799+ size_t result_length = thread.result_length .load (std::memory_order_acquire);
800+
801+ if (result_length > processed) {
799802 {
800803 std::scoped_lock lock (thread.result_mutex );
801804 thread.queue_results .swap (thread.queue_send );
@@ -816,7 +819,7 @@ void post_process_threaded_collisions() {
816819 processed += thread.queue_send ->size ();
817820 thread.queue_send ->clear ();
818821 }
819- else if (thread. queue_length . load (std::memory_order_acquire) == 0 ) {
822+ else if (queue_length == 0 ) {
820823 thread.queue_results ->clear ();
821824 workerThreads.erase (i);
822825 break ;
You can’t perform that action at this time.
0 commit comments