mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Forgot to lock for new_mutators
This commit is contained in:
parent
f3d9228d5e
commit
cdbf81c56a
2 changed files with 5 additions and 1 deletions
2
gc.c
2
gc.c
|
@ -273,8 +273,10 @@ void gc_add_mutator(gc_thread_data * thd)
|
|||
primordial_thread = thd;
|
||||
} else {
|
||||
// At this point the mutator is running, so remove it from the new list
|
||||
pthread_mutex_lock(&mutators_lock);
|
||||
ck_array_remove(&new_mutators, (void *)thd);
|
||||
ck_array_commit(&new_mutators);
|
||||
pthread_mutex_unlock(&mutators_lock);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
(define (sum-loop n)
|
||||
(mutex-lock! m)
|
||||
(set! *sum* (+ *sum* 1))
|
||||
(set! *sum* (make-shared (+ *sum* 1)))
|
||||
(mutex-unlock! m)
|
||||
;(swap! *sum* + 1)
|
||||
(if (zero? n)
|
||||
|
@ -42,5 +42,7 @@
|
|||
(thread-join! t5)
|
||||
(thread-join! t6)
|
||||
(display "main thread done, sum = ")
|
||||
(mutex-lock! m)
|
||||
(display *sum*)
|
||||
(newline)
|
||||
(mutex-unlock! m)
|
||||
|
|
Loading…
Add table
Reference in a new issue