Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.

Commit 0318aa5

Browse files
committed
#get/#set have 'volatile' semantics when compiled on Mac OS X
1 parent c2ab5fa commit 0318aa5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/atomic_reference.c

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ static VALUE ir_get(VALUE self) {
4141
__sync_synchronize();
4242
#elif defined _MSC_VER
4343
MemoryBarrier();
44+
#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
45+
OSMemoryBarrier();
4446
#endif
4547
return (VALUE) DATA_PTR(self);
4648
}
@@ -51,6 +53,8 @@ static VALUE ir_set(VALUE self, VALUE new_value) {
5153
__sync_synchronize();
5254
#elif defined _MSC_VER
5355
MemoryBarrier();
56+
#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
57+
OSMemoryBarrier();
5458
#endif
5559
return new_value;
5660
}

0 commit comments

Comments
 (0)