about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-08-05 15:16:48 -0700
committerEric Holk <eholk@mozilla.com>2011-08-05 15:27:28 -0700
commitb62e80c1f022131da963da84ef6768f300c2c5c3 (patch)
tree5b975cd8fe1a872b9ac0bd0a9739d516588fa5ca /src/rt/rust_builtin.cpp
parent200bbcf91b4eb190cff227127cc60a333f9c33a2 (diff)
downloadrust-b62e80c1f022131da963da84ef6768f300c2c5c3.tar.gz
rust-b62e80c1f022131da963da84ef6768f300c2c5c3.zip
Atomic ref counting for chans.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 99eb61aff36..1b6ad431cab 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -905,8 +905,13 @@ void del_chan(rust_task *task, rust_chan *chan) {
 }
 
 extern "C" CDECL
+void take_chan(rust_task *task, rust_chan *chan) {
+    chan->ref();
+}
+
+extern "C" CDECL
 void drop_chan(rust_task *task, rust_chan *chan) {
-    chan->ref_count--;
+    chan->deref();
 }
 
 extern "C" CDECL