Project

General

Profile

Bug #5368 » patch.diff

Glass_saga (Masaki Matsushita), 09/26/2011 01:51 PM

View differences:

thread.c
366 366
    rb_threadptr_unlock_all_locking_mutexes(th);
367 367

  
368 368
    thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th);
369
    st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
370 369
    vm->inhibit_thread_creation = 1;
371 370

  
372 371
    while (!rb_thread_alone()) {
373
	PUSH_TAG();
374
	if (EXEC_TAG() == 0) {
375
	    rb_thread_schedule();
372
	if(GET_THREAD() == th) {
373
		st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
374
		rb_thread_schedule();
376 375
	}
377 376
	else {
378
	    /* ignore exception */
377
		PUSH_TAG();
378
		if (EXEC_TAG() == 0) {
379
			rb_thread_schedule();
380
		}
381
		else {
382
			/* ignore exception */
383
		}
384
		POP_TAG();
379 385
	}
380
	POP_TAG();
381 386
    }
382 387
}
383 388