rt: Add sanity checks when we hit the max task/port id

This commit is contained in:
Brian Anderson 2012-02-03 17:31:00 -08:00
parent 12fa90888e
commit c7777f4fd9
2 changed files with 2 additions and 0 deletions

View file

@ -89,6 +89,7 @@ rust_kernel::register_task(rust_task *task) {
task->user.id = max_task_id++;
task_table.put(task->user.id, task);
}
K(srv, task->user.id != INTPTR_MAX, "Hit the maximum task id");
KLOG_("Registered task %" PRIdPTR, task->user.id);
int new_live_tasks = sync::increment(live_tasks);
KLOG_("Total outstanding tasks: %d", new_live_tasks);

View file

@ -628,6 +628,7 @@ rust_port_id rust_task::register_port(rust_port *port) {
scoped_lock with(lock);
rust_port_id id = next_port_id++;
A(thread, id != INTPTR_MAX, "Hit the maximum port id");
port_table.put(id, port);
return id;
}