diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-08-05 15:16:48 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-08-05 15:27:28 -0700 |
| commit | b62e80c1f022131da963da84ef6768f300c2c5c3 (patch) | |
| tree | 5b975cd8fe1a872b9ac0bd0a9739d516588fa5ca /src/rt/rust_upcall.cpp | |
| parent | 200bbcf91b4eb190cff227127cc60a333f9c33a2 (diff) | |
| download | rust-b62e80c1f022131da963da84ef6768f300c2c5c3.tar.gz rust-b62e80c1f022131da963da84ef6768f300c2c5c3.zip | |
Atomic ref counting for chans.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 02fa7bc2846..2190ec7b49f 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -508,6 +508,22 @@ upcall_drop_task(rust_task *task, rust_task *target) { } } +extern "C" CDECL void +upcall_take_chan(rust_task *task, rust_chan *target) { + LOG_UPCALL_ENTRY(task); + if(target) { + target->ref(); + } +} + +extern "C" CDECL void +upcall_drop_chan(rust_task *task, rust_chan *target) { + LOG_UPCALL_ENTRY(task); + if(target) { + target->deref(); + } +} + extern "C" CDECL rust_task * upcall_start_task(rust_task *spawner, rust_task *task, |
