From 3dd522b6b78fe32c44af571098d0ff4d1dcc9398 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 28 Jul 2011 15:57:59 -0700 Subject: [PATCH] Add an assertion about the lock in rust_chan::disassociate --- src/rt/rust_chan.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rt/rust_chan.cpp b/src/rt/rust_chan.cpp index e32c4214afc6..9017e9a2bc18 100644 --- a/src/rt/rust_chan.cpp +++ b/src/rt/rust_chan.cpp @@ -51,7 +51,9 @@ bool rust_chan::is_associated() { * Unlink this channel from its associated port. */ void rust_chan::disassociate() { - // Precondition: port->referent()->lock must be held + A(kernel, + port->referent()->lock.lock_held_by_current_thread(), + "Port referent lock must be held to call rust_chan::disassociate"); A(kernel, is_associated(), "Channel must be associated with a port."); if (port->is_proxy() == false) {