aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-07-28 16:24:50 -0700
committerGraydon Hoare <[email protected]>2010-07-28 20:30:29 -0700
commit4ff8e15128f90d4e9e57897c48280c6f82bb8343 (patch)
tree86c3808e729b4f596c3c23e228738d3d25b108bc /src/rt/rust_task.cpp
parentRename rust_proxy_delegate to maybe_proxy, flesh out logic in it. Add strong-... (diff)
downloadrust-4ff8e15128f90d4e9e57897c48280c6f82bb8343.tar.xz
rust-4ff8e15128f90d4e9e57897c48280c6f82bb8343.zip
Move notification-messages out into their own file and unify into notify_message, make them use proxies, cache task proxies in dom.
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 189824ac..b3caac25 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -385,6 +385,24 @@ rust_task::notify_waiting_tasks()
}
}
+void
+rust_task::notify_tasks_waiting_to_join() {
+ while (tasks_waiting_to_join.is_empty() == false) {
+ log(rust_log::ALL, "notify_tasks_waiting_to_join: %d",
+ tasks_waiting_to_join.size());
+ maybe_proxy<rust_task> *waiting_task = tasks_waiting_to_join.pop();
+ if (waiting_task->is_proxy()) {
+ notify_message::send(notify_message::WAKEUP, "wakeup",
+ this, waiting_task->as_proxy());
+ } else {
+ rust_task *task = waiting_task->delegate();
+ if (task->dead() == false) {
+ task->wakeup(this);
+ }
+ }
+ }
+}
+
uintptr_t
rust_task::get_fp() {
// sp in any suspended task points to the last callee-saved reg on