mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 13:49:16 +02:00
Fixed bug with previous change
Do not change mutator status prior to checking it
This commit is contained in:
parent
66ef2e2646
commit
6693b4533a
1 changed files with 4 additions and 3 deletions
7
gc.c
7
gc.c
|
@ -836,7 +836,7 @@ void gc_mut_update(gc_thread_data *thd, object old_obj, object value)
|
||||||
// TODO: still need to handle case where a mutator is blocked
|
// TODO: still need to handle case where a mutator is blocked
|
||||||
void gc_mut_cooperate(gc_thread_data *thd, int buf_len)
|
void gc_mut_cooperate(gc_thread_data *thd, int buf_len)
|
||||||
{
|
{
|
||||||
int i;
|
int i, status;
|
||||||
#if GC_DEBUG_VERBOSE
|
#if GC_DEBUG_VERBOSE
|
||||||
int debug_print = 0;
|
int debug_print = 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -847,8 +847,8 @@ void gc_mut_cooperate(gc_thread_data *thd, int buf_len)
|
||||||
thd->pending_writes = 0;
|
thd->pending_writes = 0;
|
||||||
pthread_mutex_unlock(&(thd->lock));
|
pthread_mutex_unlock(&(thd->lock));
|
||||||
|
|
||||||
if (thd->gc_status != ATOMIC_GET(&gc_status_col)) {
|
status = ATOMIC_GET(&gc_status_col);
|
||||||
thd->gc_status = ATOMIC_GET(&gc_status_col);
|
if (thd->gc_status != status) {
|
||||||
if (thd->gc_status == STATUS_ASYNC) {
|
if (thd->gc_status == STATUS_ASYNC) {
|
||||||
// Async is done, so clean up old mark data from the last collection
|
// Async is done, so clean up old mark data from the last collection
|
||||||
pthread_mutex_lock(&(thd->lock));
|
pthread_mutex_lock(&(thd->lock));
|
||||||
|
@ -876,6 +876,7 @@ void gc_mut_cooperate(gc_thread_data *thd, int buf_len)
|
||||||
pthread_mutex_unlock(&(thd->lock));
|
pthread_mutex_unlock(&(thd->lock));
|
||||||
thd->gc_alloc_color = ATOMIC_GET(&gc_color_mark);
|
thd->gc_alloc_color = ATOMIC_GET(&gc_color_mark);
|
||||||
}
|
}
|
||||||
|
thd->gc_status = status;
|
||||||
}
|
}
|
||||||
#if GC_DEBUG_VERBOSE
|
#if GC_DEBUG_VERBOSE
|
||||||
if (debug_print) {
|
if (debug_print) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue