mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Bugfix
This commit is contained in:
parent
43ff5c5454
commit
6ae7a88e53
1 changed files with 6 additions and 6 deletions
12
gc.c
12
gc.c
|
@ -1157,24 +1157,24 @@ void gc_wait_handshake()
|
|||
|
||||
thread_status = ATOMIC_GET(&(m->thread_state));
|
||||
if (thread_status == CYC_THREAD_STATE_BLOCKED) {
|
||||
if (statusc == STATUS_SYNC1) {
|
||||
ATOMIC_SET_IF_EQ(&(m->gc_status), statusc, statusm);
|
||||
if (statusm == STATUS_ASYNC) { // Prev state
|
||||
ATOMIC_SET_IF_EQ(&(m->gc_status), statusm, statusc);
|
||||
// Async is done, so clean up old mark data from the last collection
|
||||
pthread_mutex_lock(&(m->lock));
|
||||
m->last_write = 0;
|
||||
m->last_read = 0;
|
||||
m->pending_writes = 0;
|
||||
pthread_mutex_unlock(&(m->lock));
|
||||
}else if (statusc == STATUS_SYNC2) {
|
||||
ATOMIC_SET_IF_EQ(&(m->gc_status), statusc, statusm);
|
||||
} else if (statusc == STATUS_ASYNC) {
|
||||
}else if (statusm == STATUS_SYNC1) {
|
||||
ATOMIC_SET_IF_EQ(&(m->gc_status), statusm, statusc);
|
||||
} else if (statusm == STATUS_SYNC2) {
|
||||
printf("DEBUG - is mutator still blocked?\n");
|
||||
// Check again, if thread is still blocked we need to cooperate
|
||||
if (ATOMIC_SET_IF_EQ(&(m->thread_state),
|
||||
CYC_THREAD_STATE_BLOCKED,
|
||||
CYC_THREAD_STATE_BLOCKED_COOPERATING)) {
|
||||
printf("DEBUG - update mutator GC status\n");
|
||||
ATOMIC_SET_IF_EQ(&(m->gc_status), statusc, statusm);
|
||||
ATOMIC_SET_IF_EQ(&(m->gc_status), statusm, statusc);
|
||||
pthread_mutex_lock(&(m->lock));
|
||||
printf("DEBUG - collector is cooperating for blocked mutator\n");
|
||||
buf_len = gc_minor(m, m->stack_limit, m->stack_start, m->gc_cont, NULL, 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue