Skip to content

Commit 5c0fd04

Browse files
committed
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.
1 parent b54eb04 commit 5c0fd04

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/rt/rust_chan.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ bool rust_chan::is_associated() {
5353
void rust_chan::disassociate() {
5454
A(kernel, is_associated(),
5555
"Channel must be associated with a port.");
56-
56+
scoped_lock with(port->referent()->lock);
5757
if (port->is_proxy() == false) {
58-
scoped_lock with(port->referent()->lock);
5958
KLOG(kernel, task,
6059
"disassociating chan: 0x%" PRIxPTR " from port: 0x%" PRIxPTR,
6160
this, port->referent());

0 commit comments

Comments
 (0)