Skip to content

Commit 57459ec

Browse files
author
Eric Holk
committed
Fixed another concurrency issue in channels.
1 parent 8878b12 commit 57459ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rt/rust_chan.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ rust_chan::~rust_chan() {
3232
void rust_chan::associate(maybe_proxy<rust_port> *port) {
3333
this->port = port;
3434
if (port->is_proxy() == false) {
35+
scoped_lock with(port->referent()->lock);
3536
DLOG(kernel->sched, task,
3637
"associating chan: 0x%" PRIxPTR " with port: 0x%" PRIxPTR,
3738
this, port);
@@ -54,6 +55,7 @@ void rust_chan::disassociate() {
5455
"Channel must be associated with a port.");
5556

5657
if (port->is_proxy() == false) {
58+
scoped_lock with(port->referent()->lock);
5759
DLOG(kernel->sched, task,
5860
"disassociating chan: 0x%" PRIxPTR " from port: 0x%" PRIxPTR,
5961
this, port->referent());

0 commit comments

Comments
 (0)