[macruby-changes] [4431] MacRuby/trunk/thread.c
source_changes at macosforge.org
source_changes at macosforge.org
Mon Aug 16 20:26:35 PDT 2010
Revision: 4431
http://trac.macosforge.org/projects/ruby/changeset/4431
Author: lsansonetti at apple.com
Date: 2010-08-16 20:26:35 -0700 (Mon, 16 Aug 2010)
Log Message:
-----------
when killing the main thread, just exit the program (patch from watson1978 at gmail.com)
Modified Paths:
--------------
MacRuby/trunk/thread.c
Modified: MacRuby/trunk/thread.c
===================================================================
--- MacRuby/trunk/thread.c 2010-08-17 02:50:32 UTC (rev 4430)
+++ MacRuby/trunk/thread.c 2010-08-17 03:26:35 UTC (rev 4431)
@@ -328,6 +328,10 @@
rb_thread_kill(VALUE thread, SEL sel)
{
rb_vm_thread_t *t = GetThreadPtr(thread);
+ rb_vm_thread_t *t_main = GetThreadPtr(rb_vm_main_thread());
+ if (t->thread == t_main->thread) {
+ rb_exit(EXIT_SUCCESS);
+ }
if (t->status != THREAD_KILLED) {
rb_vm_thread_cancel(t);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100816/c50ec279/attachment-0001.html>
More information about the macruby-changes
mailing list