[macruby-changes] [4454] MacRuby/trunk/thread.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Aug 23 18:33:34 PDT 2010


Revision: 4454
          http://trac.macosforge.org/projects/ruby/changeset/4454
Author:   lsansonetti at apple.com
Date:     2010-08-23 18:33:32 -0700 (Mon, 23 Aug 2010)
Log Message:
-----------
honor ThreadGroup frozen state

Modified Paths:
--------------
    MacRuby/trunk/thread.c

Modified: MacRuby/trunk/thread.c
===================================================================
--- MacRuby/trunk/thread.c	2010-08-24 01:18:11 UTC (rev 4453)
+++ MacRuby/trunk/thread.c	2010-08-24 01:33:32 UTC (rev 4454)
@@ -1248,6 +1248,10 @@
 static VALUE
 thgroup_add(VALUE group, SEL sel, VALUE thread)
 {
+    if (OBJ_FROZEN(group)) {
+	rb_raise(rb_eThreadError, "can't move to the frozen thread group");
+    }
+
     rb_vm_thread_t *t = GetThreadPtr(thread);
 
     rb_thread_group_t *new_tg = GetThreadGroupPtr(group);
@@ -1256,6 +1260,10 @@
     }
 
     if (t->group != Qnil) {
+	if (OBJ_FROZEN(t->group)) {
+	    rb_raise(rb_eThreadError,
+		    "can't move from the frozen thread group");
+	}
 	rb_thread_group_t *old_tg = GetThreadGroupPtr(t->group);
 	if (old_tg->enclosed) {
 	    rb_raise(rb_eThreadError,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100823/e788619e/attachment-0001.html>


More information about the macruby-changes mailing list