sleep_forever.patch

Tomoyuki Chikanaga, 06/24/2011 11:10 PM

Download (1.23 KB)

View differences:

thread.c
834 834
sleep_forever(rb_thread_t *th, int deadlockable)
835 835
{
836 836
    enum rb_thread_status prev_status = th->status;
837
    enum rb_thread_status status = deadlockable ? THREAD_STOPPED_FOREVER : THREAD_STOPPED;
837 838

  
838
    th->status = deadlockable ? THREAD_STOPPED_FOREVER : THREAD_STOPPED;
839
    th->status = status;
839 840
    do {
840 841
	if (deadlockable) {
841 842
	    th->vm->sleeper++;
......
846 847
	    th->vm->sleeper--;
847 848
	}
848 849
	RUBY_VM_CHECK_INTS();
849
    } while (th->status == THREAD_STOPPED_FOREVER);
850
    } while (th->status == status);
850 851
    th->status = prev_status;
851 852
}
852 853

  
......
2953 2954
    /* mth must be main_thread */
2954 2955

  
2955 2956
    if (!mth->exec_signal && (sig = rb_get_next_signal()) > 0) {
2956
	enum rb_thread_status prev_status = mth->status;
2957 2957
	thread_debug("main_thread: %s, sig: %d\n",
2958
		     thread_status_name(prev_status), sig);
2958
		     thread_status_name(mth->status), sig);
2959 2959
	mth->exec_signal = sig;
2960
	if (mth->status != THREAD_KILLED) mth->status = THREAD_RUNNABLE;
2961 2960
	rb_threadptr_interrupt(mth);
2962
	mth->status = prev_status;
2963 2961
    }
2964 2962
}
2965 2963