From 5c0fd045cef262b748aa81321468aeb933f85833 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 27 Jul 2011 21:18:22 -0700 Subject: [PATCH] Fiddle with the locking around channel disassociation This still looks a bit sketchy to me (why isn't there locking in port::destroy?) but this manages to get rid of a problem with channels accessing their task after it's NULL. --- src/rt/rust_chan.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rt/rust_chan.cpp b/src/rt/rust_chan.cpp index d77b196fd35c0..44d45f693e73f 100644 --- a/src/rt/rust_chan.cpp +++ b/src/rt/rust_chan.cpp @@ -53,9 +53,8 @@ bool rust_chan::is_associated() { void rust_chan::disassociate() { A(kernel, is_associated(), "Channel must be associated with a port."); - + scoped_lock with(port->referent()->lock); if (port->is_proxy() == false) { - scoped_lock with(port->referent()->lock); KLOG(kernel, task, "disassociating chan: 0x%" PRIxPTR " from port: 0x%" PRIxPTR, this, port->referent());