mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 23:06:23 +00:00
Add an assertion about the lock in rust_chan::disassociate
This commit is contained in:
parent
d0cb62ac90
commit
3dd522b6b7
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user