Skip to content

Commit

Permalink
Don't share GC between threads. Makes PMCs thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
niner committed Nov 6, 2011
1 parent 104b6a9 commit 43ce938
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
6 changes: 1 addition & 5 deletions src/gc/gc_gms.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,11 +715,7 @@ Parrot_gc_gms_init(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args))

interp->gc_sys->get_gc_info = gc_gms_get_gc_info;

if (interp->parent_interpreter && interp->parent_interpreter->gc_sys) {
/* This is a "child" interpreter. Just reuse parent one */
self = (MarkSweep_GC*)interp->parent_interpreter->gc_sys->gc_private;
}
else {
{
size_t i;

self = mem_allocate_zeroed_typed(MarkSweep_GC);
Expand Down
6 changes: 1 addition & 5 deletions src/gc/gc_ms2.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,11 +627,7 @@ Parrot_gc_ms2_init(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args))

interp->gc_sys->get_gc_info = gc_ms2_get_gc_info;

if (interp->parent_interpreter && interp->parent_interpreter->gc_sys) {
/* This is a "child" interpreter. Just reuse parent one */
self = (MarkSweep_GC*)interp->parent_interpreter->gc_sys->gc_private;
}
else {
{
self = mem_allocate_zeroed_typed(MarkSweep_GC);

self->pmc_allocator = Parrot_gc_pool_new(interp,
Expand Down
3 changes: 0 additions & 3 deletions src/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ Parrot_thread_outer_runloop(ARGIN_NULLOK(void *arg))
Parrot_Scheduler_attributes * const sched = PARROT_SCHEDULER(scheduler);
INTVAL alarm_count;

Parrot_block_GC_mark(interp);
Parrot_block_GC_sweep(interp);

/* need to set it here because argument passing can trigger GC */
/* interp->lo_var_ptr = &lo_var_ptr; */

Expand Down

0 comments on commit 43ce938

Please sign in to comment.