summaryrefslogtreecommitdiffstats
path: root/ext/tcltklib/tcltklib.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-23 08:11:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-23 08:11:21 +0000
commitf5268abe45030a7a109f3b20a8db5f7537039726 (patch)
tree1a25141e5bc6ba282176cd81489f3eac7267582a /ext/tcltklib/tcltklib.c
parent521f3c08c26f96d35802605b11a2f691db7add92 (diff)
downloadruby-f5268abe45030a7a109f3b20a8db5f7537039726.tar.gz
ruby-f5268abe45030a7a109f3b20a8db5f7537039726.tar.xz
ruby-f5268abe45030a7a109f3b20a8db5f7537039726.zip
* eval.c (ruby_finalize): turn off ruby_debug flag before calling
at_exit procs and finalizers. (ruby-bugs-ja:PR473) * ext/tcltklib/tcltklib.c (lib_mainloop_core): OK to block if there's no other thread. (ruby-bugs:PR#861) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tcltklib/tcltklib.c')
-rw-r--r--ext/tcltklib/tcltklib.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 95abb5a8c..41c3a2d31 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -58,7 +58,6 @@ struct invoke_queue {
VALUE thread;
};
-static VALUE main_thread;
static VALUE eventloop_thread;
static VALUE watchdog_thread;
Tcl_Interp *current_interp;
@@ -151,7 +150,7 @@ set_eventloop_weight(self, loop_max, no_event)
int no_ev = NUM2INT(no_event);
if (lpmax <= 0 || no_ev <= 0) {
- rb_raise(rb_eArgError, "weight parameters must be plus number");
+ rb_raise(rb_eArgError, "weight parameters must be positive numbers");
}
event_loop_max = lpmax;
@@ -185,7 +184,7 @@ lib_mainloop_core(check_root_widget)
for(;;) {
tick_counter = 0;
while(tick_counter < event_loop_max) {
- if (Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT)) {
+ if (Tcl_DoOneEvent(TCL_ALL_EVENTS | (rb_thread_alone() ? 0 : TCL_DONT_WAIT))) {
tick_counter++;
} else {
tick_counter += no_event_tick;
@@ -886,7 +885,6 @@ Init_tcltklib()
rb_define_method(ip, "get_eventloop_weight", get_eventloop_weight, 0);
rb_define_method(ip, "restart", lib_restart, 0);
- main_thread = rb_thread_current();
eventloop_thread = 0;
watchdog_thread = 0;