diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-04-16 10:39:21 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-04-16 10:39:21 +0000 |
commit | d5db6fd46ef39538766493e1221ca070cff26148 (patch) | |
tree | e35bec6817292342a5741d5558faf39d13b35aac | |
parent | ddd90c76e150f88ffb1a64f591dcefee8afa1f56 (diff) |
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | eval.c | 2 | ||||
-rw-r--r-- | ext/tcltklib/tcltklib.c | 14 | ||||
-rw-r--r-- | lib/tk.rb | 11 | ||||
-rw-r--r-- | sample/tkline.rb | 1 |
5 files changed, 11 insertions, 19 deletions
@@ -1,5 +1,7 @@ Thu Apr 16 16:52:01 1998 Yukihiro Matsumoto <matz@netlab.co.jp> + * lib/tk.rb: thread support (experimental - maybe slow). + * eval.c (rb_longjmp): trace event on exception in raising context, just before raising exception. @@ -3520,7 +3520,7 @@ rb_call(klass, recv, mid, argc, argv, scope) VALUE *argv; /* OK */ int scope; { - NODE *body; /* OK */ + NODE *body; /* OK */ int noex; ID id = mid; struct cache_entry *ent; diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c index 6bebb88f9b..aa2cf71be0 100644 --- a/ext/tcltklib/tcltklib.c +++ b/ext/tcltklib/tcltklib.c @@ -33,23 +33,13 @@ int *tclDummyMathPtr = (int *) matherr; /*---- module TclTkLib ----*/ -static VALUE thread_safe = Qnil; - /* execute Tk_MainLoop */ static VALUE lib_mainloop(VALUE self) { - int old_trapflg; - int flags = RTEST(thread_safe)?TCL_DONT_WAIT:0; - DUMP1("start Tk_Mainloop"); while (Tk_GetNumMainWindows() > 0) { - old_trapflg = trap_immediate; - trap_immediate = 1; - Tcl_DoOneEvent(flags); - trap_immediate = old_trapflg; - CHECK_INTS; - flags = (thread_safe == 0 || thread_safe == Qnil)?0:TCL_DONT_WAIT; + Tcl_DoOneEvent(0); } DUMP1("stop Tk_Mainloop"); @@ -210,8 +200,6 @@ void Init_tcltklib() /* from Tk_Main() */ DUMP1("Tcl_FindExecutable"); Tcl_FindExecutable(RSTRING(rb_argv0)->ptr); - - rb_define_variable("$tk_thread_safe", &thread_safe); } /* eof */ @@ -268,6 +268,13 @@ module TkCore end def mainloop + if defined?(Thread) + INTERP._eval("proc rb_after {} { + ruby {Thread.pass}; + after 200 rb_after + }") + INTERP._eval("rb_after") + end TclTkLib.mainloop end @@ -317,10 +324,6 @@ module Tk tk_call 'bell' end - def mainloop - TclTkLib.mainloop - end - module Scrollable def xscrollcommand(cmd=Proc.new) configure_cmd 'xscrollcommand', cmd diff --git a/sample/tkline.rb b/sample/tkline.rb index 63d763a680..2406b0749f 100644 --- a/sample/tkline.rb +++ b/sample/tkline.rb @@ -1,5 +1,4 @@ -$tk_thread_safe = TRUE require "tkclass" $tkline_init = FALSE |