rt: Move some locking from rust_port to rust_task

This commit is contained in:
Brian Anderson
2012-03-03 02:46:18 -08:00
parent e3ccac8ed3
commit 93fa933a19
2 changed files with 2 additions and 6 deletions

View File

@@ -21,11 +21,7 @@ rust_port::~rust_port() {
} }
void rust_port::detach() { void rust_port::detach() {
I(task->thread, !task->port_lock.lock_held_by_current_thread()); task->release_port(id);
scoped_lock with(task->port_lock);
{
task->release_port(id);
}
} }
void rust_port::send(void *sptr) { void rust_port::send(void *sptr) {

View File

@@ -481,7 +481,7 @@ rust_port_id rust_task::register_port(rust_port *port) {
} }
void rust_task::release_port(rust_port_id id) { void rust_task::release_port(rust_port_id id) {
I(thread, port_lock.lock_held_by_current_thread()); scoped_lock with(port_lock);
port_table.remove(id); port_table.remove(id);
} }