Skip to content

Commit 3dd522b

Browse files
committed
Add an assertion about the lock in rust_chan::disassociate
1 parent d0cb62a commit 3dd522b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rt/rust_chan.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ bool rust_chan::is_associated() {
5151
* Unlink this channel from its associated port.
5252
*/
5353
void rust_chan::disassociate() {
54-
// Precondition: port->referent()->lock must be held
54+
A(kernel,
55+
port->referent()->lock.lock_held_by_current_thread(),
56+
"Port referent lock must be held to call rust_chan::disassociate");
5557
A(kernel, is_associated(),
5658
"Channel must be associated with a port.");
5759
if (port->is_proxy() == false) {

0 commit comments

Comments
 (0)