aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-09-15 11:56:45 -0700
committerMichael Bebenita <[email protected]>2010-09-16 00:51:03 -0700
commit1bd331b7aaa24245f86868305ab64600683a41e1 (patch)
tree1b088c433bc95ee416eefe502b0dca866b5dead6 /src/rt/rust_kernel.cpp
parentAdd beginnings of a fuzzer to rustboot. (diff)
downloadrust-1bd331b7aaa24245f86868305ab64600683a41e1.tar.xz
rust-1bd331b7aaa24245f86868305ab64600683a41e1.zip
Fixed deadlock caused by the message pump not being notified of new message sends.
Diffstat (limited to 'src/rt/rust_kernel.cpp')
-rw-r--r--src/rt/rust_kernel.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index ef4220f9..0dc1369d 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -164,9 +164,7 @@ void
rust_kernel::terminate_kernel_loop() {
log(rust_log::KERN, "terminating kernel loop");
_interrupt_kernel_loop = true;
- _kernel_lock.lock();
- _kernel_lock.signal_all();
- _kernel_lock.unlock();
+ signal_kernel_lock();
join();
}
@@ -217,6 +215,23 @@ rust_kernel::free_handles(hash_map<T*, rust_handle<T>* > &map) {
}
}
+void
+rust_kernel::notify_message_enqueued(rust_message_queue *queue,
+ rust_message *message) {
+ // The message pump needs to handle this message if the queue is not
+ // associated with a domain, therefore signal the message pump.
+ if (queue->is_associated() == false) {
+ signal_kernel_lock();
+ }
+}
+
+void
+rust_kernel::signal_kernel_lock() {
+ _kernel_lock.lock();
+ _kernel_lock.signal_all();
+ _kernel_lock.unlock();
+}
+
//
// Local Variables:
// mode: C++