[4500] MacRuby/trunk/thread.c
Revision: 4500 http://trac.macosforge.org/projects/ruby/changeset/4500 Author: lsansonetti@apple.com Date: 2010-09-09 23:03:14 -0700 (Thu, 09 Sep 2010) Log Message: ----------- implement missing MRI API: rb_thread_local_aref/aset Modified Paths: -------------- MacRuby/trunk/thread.c Modified: MacRuby/trunk/thread.c =================================================================== --- MacRuby/trunk/thread.c 2010-09-10 03:39:53 UTC (rev 4499) +++ MacRuby/trunk/thread.c 2010-09-10 06:03:14 UTC (rev 4500) @@ -772,6 +772,12 @@ return Qnil; } +VALUE +rb_thread_local_aref(VALUE self, ID key) +{ + return rb_thread_aref(self, 0, ID2SYM(key)); +} + /* * call-seq: * thr[sym] = obj => obj @@ -781,12 +787,18 @@ */ static VALUE -rb_thread_aset(VALUE self, SEL sel, ID key, VALUE val) +rb_thread_aset(VALUE self, SEL sel, VALUE key, VALUE val) { key = ID2SYM(rb_to_id(key)); return rb_hash_aset(rb_vm_thread_locals(self, true), key, val); } +VALUE +rb_thread_local_aset(VALUE self, ID key, VALUE val) +{ + return rb_thread_aset(self, 0, ID2SYM(key), val); +} + /* * call-seq: * thr.key?(sym) => true or false
participants (1)
-
source_changes@macosforge.org