diff options
| author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-29 15:54:32 +0000 |
|---|---|---|
| committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-09-29 15:54:32 +0000 |
| commit | c18c0627411b37bf9298caa1c1bf577448c264cf (patch) | |
| tree | c5f5cf3df2d4627cc1f5d3aa69ae0fcc53a4f57c /ext/tk/lib/multi-tk.rb | |
| parent | c22d1f2be340fda6b6a571e177a857c27b24a9d1 (diff) | |
| download | ruby-c18c0627411b37bf9298caa1c1bf577448c264cf.tar.gz ruby-c18c0627411b37bf9298caa1c1bf577448c264cf.tar.xz ruby-c18c0627411b37bf9298caa1c1bf577448c264cf.zip | |
* ext/tcltklib/tcltklib.c (ip_init): bug fix
* ext/tk/tkutil.c (get_eval_string_core): accept a Regexp object
* ext/tk/lib/multi-tk.rb: fix bug on 'exit' operation
* ext/tk/lib/tk/text.rb: 'tksearch' accepts a Regexp object as a
matting pattern argument
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/multi-tk.rb')
| -rw-r--r-- | ext/tk/lib/multi-tk.rb | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index 5299eee06..061123b79 100644 --- a/ext/tk/lib/multi-tk.rb +++ b/ext/tk/lib/multi-tk.rb @@ -125,7 +125,10 @@ class MultiTkIp if wait == 0 # no wait - thread.raise exception + Thread.pass + if thread.stop? + thread.raise exception + end return thread end @@ -294,7 +297,8 @@ class MultiTkIp obj.delete unless obj.deleted? } =end - exit + #exit(e.status) + fail e end # break @@ -1325,14 +1329,19 @@ class MultiTkIp rescue MultiTkIp_OK => ret # return value return ret.value - rescue SystemExit + rescue SystemExit => e # exit IP warn("Warning: " + $! + " on " + self.inspect) if $DEBUG begin self._eval_without_enc('exit') rescue Exception end - self.delete + if !safe? && allow_ruby_exit? + self.delete + fail e + else + self.delete + end rescue Exception => e if $DEBUG warn("Warning: " + e.class.inspect + @@ -1542,10 +1551,18 @@ class << MultiTkIp __getip.deleted? end - def exit(st = 0) + def abort(msg = nil) + __getip.abort(msg) + end + + def exit(st = true) __getip.exit(st) end + def exit!(st = false) + __getip.exit!(st) + end + def restart(app_name = nil, keys = {}) init_ip_internal @@ -1852,7 +1869,21 @@ class MultiTkIp @interp.deleted? end - def exit(st = 0) + def abort(msg = nil) + if master? + if msg + Kernel.abort(msg) + else + Kernel.abort + end + else + # ignore msg + delete + 1 + end + end + + def exit(st = true) if master? Kernel.exit(st) else @@ -1861,6 +1892,15 @@ class MultiTkIp end end + def exit!(st = false) + if master? && !safe? && allow_ruby_exit? + Kernel.exit!(st) + else + delete + st + end + end + def restart(app_name = nil, keys = {}) _init_ip_internal(@@INIT_IP_ENV, @@ADD_TK_PROCS) |
