diff --git a/gc.c b/gc.c index f3f67433..f7bc528f 100644 --- a/gc.c +++ b/gc.c @@ -583,8 +583,10 @@ void gc_mut_cooperate(gc_thread_data *thd) if (thd->gc_status != status) { if (thd->gc_status == STATUS_ASYNC) { // Async is done, so clean up old mark data from the last collection + pthread_mutex_lock(&(thd->lock)); thd->last_write = 0; thd->last_read = 0; + pthread_mutex_unlock(&(thd->lock)); } else if (thd->gc_status == STATUS_SYNC2) { // Mark thread "roots"