Modified: MacRuby/trunk/bridgesupport.cpp (4490 => 4491)
--- MacRuby/trunk/bridgesupport.cpp 2010-09-03 01:10:20 UTC (rev 4490)
+++ MacRuby/trunk/bridgesupport.cpp 2010-09-03 01:35:21 UTC (rev 4491)
@@ -391,8 +391,10 @@
{
// Generate the real #new method.
rb_vm_bs_boxed_t *bs_boxed = locate_bs_boxed(rcv, true);
+ GET_CORE()->lock();
Function *f = RoxorCompiler::shared->compile_bs_struct_new(bs_boxed);
IMP imp = GET_CORE()->compile(f);
+ GET_CORE()->unlock();
// Replace the fake method with the new one in the runtime.
rb_objc_define_method(*(VALUE *)rcv, "new", (void *)imp, -1);
@@ -425,9 +427,11 @@
assert(field != -1);
// Generate the new setter method.
+ GET_CORE()->lock();
Function *f = RoxorCompiler::shared->compile_bs_struct_writer(
bs_boxed, field);
IMP imp = GET_CORE()->compile(f);
+ GET_CORE()->unlock();
// Replace the fake method with the new one in the runtime.
buf[s - 1] = '=';
Modified: MacRuby/trunk/vm.cpp (4490 => 4491)
--- MacRuby/trunk/vm.cpp 2010-09-03 01:10:20 UTC (rev 4490)
+++ MacRuby/trunk/vm.cpp 2010-09-03 01:35:21 UTC (rev 4491)
@@ -2875,6 +2875,8 @@
void *
RoxorCore::gen_to_rval_convertor(std::string type)
{
+ RoxorCoreLock lock;
+
std::map<std::string, void *>::iterator iter =
to_rval_convertors.find(type);
if (iter != to_rval_convertors.end()) {