Atomic ref counting for chans.

This commit is contained in:
Eric Holk
2011-08-05 15:16:48 -07:00
parent 200bbcf91b
commit b62e80c1f0
12 changed files with 61 additions and 38 deletions

View File

@@ -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