A shareable atomically reference counted pointer wrapper.

Needs more tests to ensure safety, and probably some more work on usability too.
This commit is contained in:
Eric Holk
2012-05-23 14:53:44 -07:00
parent 9773a22119
commit 6fa1a084f7
5 changed files with 101 additions and 1 deletions

View File

@@ -816,6 +816,16 @@ rust_compare_and_swap_ptr(intptr_t *address,
return sync::compare_and_swap(address, oldval, newval);
}
extern "C" CDECL intptr_t
rust_atomic_increment(intptr_t *address) {
return sync::increment(address);
}
extern "C" CDECL intptr_t
rust_atomic_decrement(intptr_t *address) {
return sync::decrement(address);
}
extern "C" CDECL void
rust_task_weaken(rust_port_id chan) {
rust_task *task = rust_get_current_task();