From d2a9e77748684e786af9525e258aee98c8ff2a8d Mon Sep 17 00:00:00 2001 From: nagai Date: Thu, 10 Mar 2005 10:13:30 +0000 Subject: * ext/tk/tcltklib.c (lib_eventloop_ensure): mis-delete a timer handler when exit from a recursive called eventloop * ext/tk/lib/tk/timer.rb: new TkRTTimer class, which can works for a realtime operation * ext/tk/sample/tkrttimer.rb: sample of TkRTTimer class * ext/tk/lib/tk/textmark.rb: move TkTextMark#+ and TkTextMark#- to TkText::IndexModMethods * ext/tk/lib/tk/text.rb: improve TkTextMark#+ and TkTextMark#-, and add them to TkText::IndexModMethods module * ext/tk/sample/tktextio.rb: add test part of "seek by text index modifiers" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/tcltklib.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'ext/tk/tcltklib.c') diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index 6bc8c3185f..8756d54252 100644 --- a/ext/tk/tcltklib.c +++ b/ext/tk/tcltklib.c @@ -4,7 +4,7 @@ * Oct. 24, 1997 Y. Matsumoto */ -#define TCLTKLIB_RELEASE_DATE "2005-03-02" +#define TCLTKLIB_RELEASE_DATE "2005-03-10" #include "ruby.h" #include "rubysig.h" @@ -652,7 +652,7 @@ _timer_for_tcl(clientData) /* struct invoke_queue *q, *tmp; */ /* VALUE thread; */ - DUMP1("called timer_for_tcl"); + DUMP1("call _timer_for_tcl"); thr_crit_bup = rb_thread_critical; rb_thread_critical = Qtrue; @@ -1402,9 +1402,6 @@ lib_eventloop_ensure(args) struct evloop_params *ptr = (struct evloop_params *)args; volatile VALUE current_evloop = rb_thread_current(); - Tk_DeleteTimerHandler(timer_token); - timer_token = (Tcl_TimerToken)NULL; - DUMP2("eventloop_ensure: current-thread : %lx", current_evloop); DUMP2("eventloop_ensure: eventloop-thread : %lx", eventloop_thread); if (eventloop_thread != current_evloop) { @@ -1422,7 +1419,12 @@ lib_eventloop_ensure(args) break; } - if (NIL_P(eventloop_thread)) break; + if (NIL_P(eventloop_thread)) { + Tk_DeleteTimerHandler(timer_token); + timer_token = (Tcl_TimerToken)NULL; + + break; + } if (RTEST(rb_funcall(eventloop_thread, ID_alive_p, 0, 0))) { DUMP2("eventloop-enshure: wake up parent %lx", eventloop_thread); -- cgit v1.2.3