Skip to content

Commit

Permalink
fixed race condition in gc mark threads
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Aug 22, 2023
1 parent 6e547b3 commit 6e754cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,8 @@ static void mark_thread_main( void *param ) {
while( true ) {
hl_semaphore_acquire(inf->ready);
inf->mark_count += gc_flush_mark(&inf->stack);
hl_semaphore_release(mark_threads_done);
atomic_bit_unset(&mark_threads_active, 1 << index);
while( !atomic_bit_unset(&mark_threads_active, 1 << index) ) {};
if( mark_threads_active == 0 ) hl_semaphore_release(mark_threads_done);
}
}

Expand Down

0 comments on commit 6e754cc

Please sign in to comment.