rt: Move some locking from rust_port to rust_task
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user