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.
This commit is contained in:
Brian Anderson 2011-07-27 21:18:22 -07:00
parent b54eb0480d
commit 5c0fd045ce

View File

@ -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());