about summary refs log tree commit diff
path: root/src/rt/rust_port.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <mbebenita@mozilla.com>2010-08-17 23:21:29 -0700
committerMichael Bebenita <mbebenita@mozilla.com>2010-08-17 23:49:57 -0700
commit7ff39ea448c60e5ab993bb4a32649e60de13184d (patch)
tree8ef06fded3f193456304245b4339b888897a73db /src/rt/rust_port.cpp
parent6e9f0f952d758bae2b530c2c9b780f2addf10207 (diff)
downloadrust-7ff39ea448c60e5ab993bb4a32649e60de13184d.tar.gz
rust-7ff39ea448c60e5ab993bb4a32649e60de13184d.zip
Fixed deadlock by removing channel flushing.
Diffstat (limited to 'src/rt/rust_port.cpp')
-rw-r--r--src/rt/rust_port.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rt/rust_port.cpp b/src/rt/rust_port.cpp
index fa7790b6025..458283fb394 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;
         }