Skip to content

Commit

Permalink
Fiddle with the locking around channel disassociation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brson committed Jul 28, 2011
1 parent b54eb04 commit 5c0fd04
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rt/rust_chan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 5c0fd04

Please sign in to comment.