aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_message.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-08-09 08:15:34 -0700
committerMichael Bebenita <[email protected]>2010-08-09 08:15:34 -0700
commit97d6342bf08e55f8d2b4f8df5c4b5a099df0191c (patch)
treebfed15fefbc032deba1c34908f25c1562d88aa6b /src/rt/rust_message.cpp
parentFixed deadlock in the scheduler caused by condition variables. (diff)
downloadrust-97d6342bf08e55f8d2b4f8df5c4b5a099df0191c.tar.xz
rust-97d6342bf08e55f8d2b4f8df5c4b5a099df0191c.zip
Synthesize a flush_chan upcall right before a channel's ref_count drops to zero. This should only happen in the Rust code and not in the drop glue, or on the unwind path. This change allows the task owning the channel to block on a flush and delete its own channel. This change also cleans up some code around rust_port and rust_chan.
Diffstat (limited to 'src/rt/rust_message.cpp')
-rw-r--r--src/rt/rust_message.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/rt/rust_message.cpp b/src/rt/rust_message.cpp
index 8b396b4d..1de804c9 100644
--- a/src/rt/rust_message.cpp
+++ b/src/rt/rust_message.cpp
@@ -90,8 +90,7 @@ send(uint8_t *buffer, size_t buffer_sz, const char* label, rust_task *source,
}
void data_message::process() {
- _port->remote_channel->buffer.enqueue(_buffer);
- _port->remote_channel->transmit();
+ _port->remote_channel->send(_buffer);
_target->log(rust_log::COMM, "<=== received data via message ===");
}