From 7ff39ea448c60e5ab993bb4a32649e60de13184d Mon Sep 17 00:00:00 2001 From: Michael Bebenita Date: Tue, 17 Aug 2010 23:21:29 -0700 Subject: Fixed deadlock by removing channel flushing. --- src/rt/rust_port.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/rt/rust_port.cpp') 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; } -- cgit v1.2.3