Skip to content

Commit 93fa933

Browse files
committed
rt: Move some locking from rust_port to rust_task
1 parent e3ccac8 commit 93fa933

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/rt/rust_port.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ rust_port::~rust_port() {
2121
}
2222

2323
void rust_port::detach() {
24-
I(task->thread, !task->port_lock.lock_held_by_current_thread());
25-
scoped_lock with(task->port_lock);
26-
{
27-
task->release_port(id);
28-
}
24+
task->release_port(id);
2925
}
3026

3127
void rust_port::send(void *sptr) {

src/rt/rust_task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ rust_port_id rust_task::register_port(rust_port *port) {
481481
}
482482

483483
void rust_task::release_port(rust_port_id id) {
484-
I(thread, port_lock.lock_held_by_current_thread());
484+
scoped_lock with(port_lock);
485485
port_table.remove(id);
486486
}
487487

0 commit comments

Comments
 (0)