Skip to content

Commit

Permalink
Remove notification channels in runtime (closes #1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
bblum committed Jul 25, 2012
1 parent d9e8efc commit c68f2d9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
5 changes: 0 additions & 5 deletions src/rt/rust_builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,11 +637,6 @@ rust_new_task_in_sched(rust_sched_id id) {
return new_task_common(sched, task);
}

extern "C" CDECL void
rust_task_config_notify(rust_task *target, rust_port_id *port) {
target->config_notify(*port);
}

extern "C" rust_task *
rust_get_task() {
return rust_get_current_task();
Expand Down
26 changes: 0 additions & 26 deletions src/rt/rust_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ rust_task::rust_task(rust_sched_loop *sched_loop, rust_task_state state,
const char *name, size_t init_stack_sz) :
ref_count(1),
id(0),
notify_enabled(false),
stk(NULL),
runtime_sp(0),
sched(sched_loop->sched),
Expand Down Expand Up @@ -141,8 +140,6 @@ cleanup_task(cleanup_args *args) {

task->die();

task->notify(!threw_exception);

#ifdef __WIN32__
assert(!threw_exception && "No exception-handling yet on windows builds");
#endif
Expand Down Expand Up @@ -454,23 +451,6 @@ rust_task::calloc(size_t size, const char *tag) {
return local_region.calloc(size, tag);
}

void
rust_task::notify(bool success) {
// FIXME (#1078) Do this in rust code
if(notify_enabled) {
rust_port *target_port =
kernel->get_port_by_id(notify_port);
if(target_port) {
task_notification msg;
msg.id = id;
msg.result = !success ? tr_failure : tr_success;

target_port->send(&msg);
target_port->deref();
}
}
}

size_t
rust_task::get_next_stack_size(size_t min, size_t current, size_t requested) {
LOG(this, mem, "calculating new stack size for 0x%" PRIxPTR, this);
Expand Down Expand Up @@ -636,12 +616,6 @@ rust_task::delete_all_stacks() {
}
}

void
rust_task::config_notify(rust_port_id port) {
notify_enabled = true;
notify_port = port;
}

/*
Returns true if we're currently running on the Rust stack
*/
Expand Down
6 changes: 0 additions & 6 deletions src/rt/rust_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ rust_task : public kernel_owned<rust_task>
RUST_ATOMIC_REFCOUNT();

rust_task_id id;
bool notify_enabled;
rust_port_id notify_port;

context ctx;
stk_seg *stk;
Expand Down Expand Up @@ -285,8 +283,6 @@ rust_task : public kernel_owned<rust_task>
// not at all safe.
intptr_t get_ref_count() const { return ref_count; }

void notify(bool success);

void *next_stack(size_t stk_sz, void *args_addr, size_t args_sz);
void prev_stack();
void record_stack_limit();
Expand All @@ -296,8 +292,6 @@ rust_task : public kernel_owned<rust_task>
void check_stack_canary();
void delete_all_stacks();

void config_notify(rust_port_id port);

void call_on_c_stack(void *args, void *fn_ptr);
void call_on_rust_stack(void *args, void *fn_ptr);
bool have_c_stack() { return c_stack != NULL; }
Expand Down

0 comments on commit c68f2d9

Please sign in to comment.