rt: Add a function for configuring task notification

This commit is contained in:
Brian Anderson
2012-02-08 16:22:38 -08:00
parent e0d5b92b84
commit d756b01619
4 changed files with 19 additions and 0 deletions

View File

@@ -481,6 +481,16 @@ drop_task(rust_task *target) {
} }
} }
extern "C" CDECL void
rust_task_config_notify(rust_task_id task_id, chan_handle *chan) {
rust_task *task = rust_task_thread::get_task();
rust_task *target = task->kernel->get_task_by_id(task_id);
A(task->thread, target != NULL,
"This function should only be called when we know the task exists");
target->config_notify(*chan);
target->deref();
}
extern "C" CDECL rust_task * extern "C" CDECL rust_task *
get_task_pointer(rust_task_id id) { get_task_pointer(rust_task_id id) {
rust_task *task = rust_task_thread::get_task(); rust_task *task = rust_task_thread::get_task();

View File

@@ -713,6 +713,12 @@ rust_task::check_stack_canary() {
::check_stack_canary(stk); ::check_stack_canary(stk);
} }
void
rust_task::config_notify(chan_handle chan) {
user.notify_enabled = true;
user.notify_chan = chan;
}
// //
// Local Variables: // Local Variables:
// mode: C++ // mode: C++

View File

@@ -181,6 +181,8 @@ public:
void reset_stack_limit(); void reset_stack_limit();
bool on_rust_stack(); bool on_rust_stack();
void check_stack_canary(); void check_stack_canary();
void config_notify(chan_handle chan);
}; };
// //

View File

@@ -49,6 +49,7 @@ rust_env_pairs
rust_task_yield rust_task_yield
rust_task_is_unwinding rust_task_is_unwinding
rust_get_task rust_get_task
rust_task_config_notify
sched_threads sched_threads
shape_log_str shape_log_str
squareroot squareroot