From b62e80c1f022131da963da84ef6768f300c2c5c3 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Fri, 5 Aug 2011 15:16:48 -0700 Subject: Atomic ref counting for chans. --- src/rt/rust_builtin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/rt/rust_builtin.cpp') 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 @@ -904,9 +904,14 @@ void del_chan(rust_task *task, rust_chan *chan) { chan->destroy(); } +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 -- cgit 1.4.1-3-g733a5