rt: Move some locking from rust_port to rust_task
This commit is contained in:
parent
e3ccac8ed3
commit
93fa933a19
@ -21,11 +21,7 @@ rust_port::~rust_port() {
|
||||
}
|
||||
|
||||
void rust_port::detach() {
|
||||
I(task->thread, !task->port_lock.lock_held_by_current_thread());
|
||||
scoped_lock with(task->port_lock);
|
||||
{
|
||||
task->release_port(id);
|
||||
}
|
||||
task->release_port(id);
|
||||
}
|
||||
|
||||
void rust_port::send(void *sptr) {
|
||||
|
@ -481,7 +481,7 @@ rust_port_id rust_task::register_port(rust_port *port) {
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user