File tree 3 files changed +16
-11
lines changed
3 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -417,10 +417,20 @@ namespace rubinius {
417
417
return state->shared ().vm_fibers_count (state);
418
418
}
419
419
420
- void Fiber::finalize (STATE, Fiber* fib ) {
420
+ void Fiber::finalize (STATE, Fiber* fiber ) {
421
421
if (state->shared ().config .machine_fiber_log_finalizer .value ) {
422
422
logger::write (" fiber: finalizer: %s, %d" ,
423
- fib->thread_name ()->c_str (state), fib->fiber_id ()->to_native ());
423
+ fiber->thread_name ()->c_str (state), fiber->fiber_id ()->to_native ());
424
+ }
425
+
426
+ if (fiber->vm ()) {
427
+ if (fiber->vm ()->zombie_p ()) {
428
+ VM::discard (state, fiber->vm ());
429
+ fiber->vm (NULL );
430
+ } else {
431
+ logger::write (" fiber: finalizer: fiber not completed: %s, %d" ,
432
+ fiber->thread_name ()->c_str (state), fiber->fiber_id ()->to_native ());
433
+ }
424
434
}
425
435
}
426
436
}
Original file line number Diff line number Diff line change @@ -112,14 +112,10 @@ namespace rubinius {
112
112
logger::write (" thread: finalizer: %s" , thread->vm ()->name ().c_str ());
113
113
}
114
114
115
- thread->finalize_instance (state);
116
- }
117
-
118
- void Thread::finalize_instance (STATE) {
119
- if (vm () && vm ()->zombie_p ()) {
120
- fiber_mutex_.std ::mutex::~mutex ();
121
- VM::discard (state, vm ());
122
- vm (NULL );
115
+ if (thread->vm () && thread->vm ()->zombie_p ()) {
116
+ thread->fiber_mutex ().std ::mutex::~mutex ();
117
+ VM::discard (state, thread->vm ());
118
+ thread->vm (NULL );
123
119
}
124
120
}
125
121
Original file line number Diff line number Diff line change @@ -240,7 +240,6 @@ namespace rubinius {
240
240
static Thread* create (STATE, Class* klass, VM* vm);
241
241
242
242
static void finalize (STATE, Thread* thread);
243
- void finalize_instance (STATE);
244
243
245
244
int start_thread (STATE, void * (*function)(void *));
246
245
static void * run (void *);
You can’t perform that action at this time.
0 commit comments