Skip to content
Browse files

Make sure the C-API handles are initialized before setting them

  • Loading branch information...
1 parent fd6fcea commit 880ecc31cbda60dd1b5f36be623418c6b46adbad @dbussink dbussink committed Oct 5, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 vm/capi/handles.cpp
  2. +1 −1 vm/oop.hpp
View
2 vm/capi/handles.cpp
@@ -15,6 +15,7 @@ namespace rubinius {
if(needs_gc) {
state->memory()->collect_mature_now = true;
}
+ atomic::memory_barrier();
return handle;
}
@@ -27,6 +28,7 @@ namespace rubinius {
if(needs_gc) {
state->memory()->collect_mature_now = true;
}
+ atomic::memory_barrier();
return handle_index;
}
View
2 vm/oop.hpp
@@ -299,7 +299,7 @@ Object* const cUndef = reinterpret_cast<Object*>(0x22L);
}
void set_handle(STATE, capi::Handle* handle) {
- handle_ = handle;
+ atomic::write(&handle_, handle);
}
unsigned int inc_age() {

0 comments on commit 880ecc3

Please sign in to comment.
Something went wrong with that request. Please try again.