diff options
| author | Michael Bebenita <[email protected]> | 2010-08-17 23:21:29 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-08-17 23:49:57 -0700 |
| commit | 7ff39ea448c60e5ab993bb4a32649e60de13184d (patch) | |
| tree | 8ef06fded3f193456304245b4339b888897a73db /src/rt/rust_port.cpp | |
| parent | Made the lock_free_queue lock (temporarily, until fixed). (diff) | |
| download | rust-7ff39ea448c60e5ab993bb4a32649e60de13184d.tar.xz rust-7ff39ea448c60e5ab993bb4a32649e60de13184d.zip | |
Fixed deadlock by removing channel flushing.
Diffstat (limited to 'src/rt/rust_port.cpp')
| -rw-r--r-- | src/rt/rust_port.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rt/rust_port.cpp b/src/rt/rust_port.cpp index fa7790b6..458283fb 100644 --- a/src/rt/rust_port.cpp +++ b/src/rt/rust_port.cpp @@ -23,6 +23,12 @@ rust_port::~rust_port() { while (chans.is_empty() == false) { rust_chan *chan = chans.peek(); chan->disassociate(); + + if (chan->ref_count == 0) { + task->log(rust_log::COMM, + "chan: 0x%" PRIxPTR " is dormant, freeing", chan); + delete chan; + } } delete remote_channel; @@ -33,13 +39,6 @@ bool rust_port::receive(void *dptr) { rust_chan *chan = chans[i]; if (chan->buffer.is_empty() == false) { chan->buffer.dequeue(dptr); - if (chan->buffer.is_empty() && chan->task->blocked()) { - task->log(rust_log::COMM, - "chan: 0x%" PRIxPTR - " is flushing, wakeup task: 0x%" PRIxPTR, - chan, chan->task); - chan->task->wakeup(this); - } task->log(rust_log::COMM, "<=== read data ==="); return true; } |