From 5c0a7a0d5d2cb1bb22b7d2668510d659d67fd86d Mon Sep 17 00:00:00 2001 From: nagai Date: Thu, 10 Mar 2005 10:14:13 +0000 Subject: * ext/tcltklib/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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tcltklib/tcltklib.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'ext/tcltklib') diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c index aae7ac548..8756d5425 100644 --- a/ext/tcltklib/tcltklib.c +++ b/ext/tcltklib/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); @@ -7889,7 +7891,7 @@ lib_split_tklist_core(ip_obj, list_str) if (result == TCL_ERROR) { Tcl_DecrRefCount(listobj); if (interp == (Tcl_Interp*)NULL) { - rb_raise(rb_eRuntimeError, "cannot get elements from list"); + rb_raise(rb_eRuntimeError, "can't get elements from list"); } else { #if TCL_MAJOR_VERSION >= 8 rb_raise(rb_eRuntimeError, "%s", Tcl_GetStringResult(interp)); @@ -7961,7 +7963,7 @@ lib_split_tklist_core(ip_obj, list_str) if (Tcl_SplitList(interp, RSTRING(list_str)->ptr, &argc, &argv) == TCL_ERROR) { if (interp == (Tcl_Interp*)NULL) { - rb_raise(rb_eRuntimeError, "cannot get elements from list"); + rb_raise(rb_eRuntimeError, "can't get elements from list"); } else { rb_raise(rb_eRuntimeError, "%s", interp->result); } -- cgit