about summary refs log tree commit diff
path: root/src/rt/rust_chan.cpp
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-07-23 12:21:23 -0700
committerEric Holk <eholk@mozilla.com>2011-07-23 12:21:23 -0700
commit57459ec8ae402be358393455533cdf363866cdca (patch)
tree99e685e582c0be1f017498539354ba925f070498 /src/rt/rust_chan.cpp
parent8878b128baddfa4ee38e4f9c43be75abe0edcd3d (diff)
downloadrust-57459ec8ae402be358393455533cdf363866cdca.tar.gz
rust-57459ec8ae402be358393455533cdf363866cdca.zip
Fixed another concurrency issue in channels.
Diffstat (limited to 'src/rt/rust_chan.cpp')
-rw-r--r--src/rt/rust_chan.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rt/rust_chan.cpp b/src/rt/rust_chan.cpp
index d04f5ee8ff5..470be6e6a37 100644
--- a/src/rt/rust_chan.cpp
+++ b/src/rt/rust_chan.cpp
@@ -32,6 +32,7 @@ rust_chan::~rust_chan() {
 void rust_chan::associate(maybe_proxy<rust_port> *port) {
     this->port = port;
     if (port->is_proxy() == false) {
+        scoped_lock with(port->referent()->lock);
         DLOG(kernel->sched, task,
             "associating chan: 0x%" PRIxPTR " with port: 0x%" PRIxPTR,
             this, port);
@@ -54,6 +55,7 @@ void rust_chan::disassociate() {
       "Channel must be associated with a port.");
 
     if (port->is_proxy() == false) {
+        scoped_lock with(port->referent()->lock);
         DLOG(kernel->sched, task,
             "disassociating chan: 0x%" PRIxPTR " from port: 0x%" PRIxPTR,
             this, port->referent());