Skip to content

Commit ed7d25b

Browse files
committed
rt: Checking port_table.is_empty() requires a lock
1 parent 04d9cc1 commit ed7d25b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rt/rust_task.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,12 @@ void
108108
rust_task::delete_this()
109109
{
110110
I(thread, !thread->lock.lock_held_by_current_thread());
111-
I(thread, port_table.is_empty());
111+
112+
{
113+
scoped_lock with (lock);
114+
I(thread, port_table.is_empty());
115+
}
116+
112117
DLOG(thread, task, "~rust_task %s @0x%" PRIxPTR ", refcnt=%d",
113118
name, (uintptr_t)this, ref_count);
114119

0 commit comments

Comments
 (0)