mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Set gc_cont and num args prior to blocking
This change shouldn't hurt anything and guarantees the collector thread is not trying to use gc_cont before it is set properly.
This commit is contained in:
parent
1e823c0d3f
commit
2b04c3b253
1 changed files with 2 additions and 2 deletions
4
gc.c
4
gc.c
|
@ -1771,6 +1771,8 @@ void gc_merge_all_heaps(gc_thread_data *dest, gc_thread_data *src)
|
||||||
*/
|
*/
|
||||||
void gc_mutator_thread_blocked(gc_thread_data * thd, object cont)
|
void gc_mutator_thread_blocked(gc_thread_data * thd, object cont)
|
||||||
{
|
{
|
||||||
|
thd->gc_cont = cont;
|
||||||
|
thd->gc_num_args = 0; // Will be set later, after collection
|
||||||
if (!ck_pr_cas_int((int *)&(thd->thread_state),
|
if (!ck_pr_cas_int((int *)&(thd->thread_state),
|
||||||
CYC_THREAD_STATE_RUNNABLE, CYC_THREAD_STATE_BLOCKED)) {
|
CYC_THREAD_STATE_RUNNABLE, CYC_THREAD_STATE_BLOCKED)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
@ -1778,8 +1780,6 @@ void gc_mutator_thread_blocked(gc_thread_data * thd, object cont)
|
||||||
thd->thread_state);
|
thd->thread_state);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
thd->gc_cont = cont;
|
|
||||||
thd->gc_num_args = 0; // Will be set later, after collection
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cyc_apply_from_buf(void *data, int argc, object prim, object * buf);
|
void Cyc_apply_from_buf(void *data, int argc, object prim, object * buf);
|
||||||
|
|
Loading…
Add table
Reference in a new issue