about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-03-05 13:32:40 -0800
committerBrian Anderson <banderson@mozilla.com>2012-03-05 19:39:56 -0800
commit958c32108313658740e89dfd32c5a96ba557c0a3 (patch)
tree543f436905d84a064cdd9fdd6259b9f7240c3f3a /src/rt/rust_builtin.cpp
parent1347d04bb086f6d76dd7287762d34ef4c57dbc00 (diff)
downloadrust-958c32108313658740e89dfd32c5a96ba557c0a3.tar.gz
rust-958c32108313658740e89dfd32c5a96ba557c0a3.zip
rt: Fix the atomic get_ref_count method to avoid races
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 14b18a99252..14b6d0f1962 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -489,15 +489,11 @@ rust_port_begin_detach(rust_port *port, uintptr_t *yield) {
 }
 
 extern "C" CDECL void
-rust_port_end_detach(rust_port *port) {
-    port->end_detach();
-}
-
-extern "C" CDECL void
 del_port(rust_port *port) {
     rust_task *task = rust_task_thread::get_task();
     LOG(task, comm, "del_port(0x%" PRIxPTR ")", (uintptr_t) port);
     A(task->thread, port->get_ref_count() == 0, "Expected port ref_count == 0");
+    port->end_detach();
     delete port;
 }