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_port.cpp | |
| parent | 200bbcf91b4eb190cff227127cc60a333f9c33a2 (diff) | |
| download | rust-b62e80c1f022131da963da84ef6768f300c2c5c3.tar.gz rust-b62e80c1f022131da963da84ef6768f300c2c5c3.zip | |
Atomic ref counting for chans.
Diffstat (limited to 'src/rt/rust_port.cpp')
| -rw-r--r-- | src/rt/rust_port.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/rt/rust_port.cpp b/src/rt/rust_port.cpp index bd4cff4f235..62ee80cb1b7 100644 --- a/src/rt/rust_port.cpp +++ b/src/rt/rust_port.cpp @@ -8,10 +8,6 @@ rust_port::rust_port(rust_task *task, size_t unit_sz) LOG(task, comm, "new rust_port(task=0x%" PRIxPTR ", unit_sz=%d) -> port=0x%" PRIxPTR, (uintptr_t)task, unit_sz, (uintptr_t)this); - - // Allocate a remote channel, for remote channel data. - remote_channel = new (kernel, "remote chan") - rust_chan(kernel, this, unit_sz); } rust_port::~rust_port() { @@ -22,15 +18,7 @@ rust_port::~rust_port() { scoped_lock with(lock); rust_chan *chan = chans.peek(); chan->disassociate(); - - if (chan->ref_count == 0) { - LOG(task, comm, - "chan: 0x%" PRIxPTR " is dormant, freeing", chan); - delete chan; - } } - - delete remote_channel; } bool rust_port::receive(void *dptr) { @@ -52,10 +40,9 @@ void rust_port::log_state() { for (uint32_t i = 0; i < chans.length(); i++) { rust_chan *chan = chans[i]; LOG(task, comm, - "\tchan: 0x%" PRIxPTR ", size: %d, remote: %s", + "\tchan: 0x%" PRIxPTR ", size: %d", chan, - chan->buffer.size(), - chan == remote_channel ? "yes" : "no"); + chan->buffer.size()); } } |
