diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-07-23 12:21:23 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-07-23 12:21:23 -0700 |
| commit | 57459ec8ae402be358393455533cdf363866cdca (patch) | |
| tree | 99e685e582c0be1f017498539354ba925f070498 /src/rt/rust_chan.cpp | |
| parent | 8878b128baddfa4ee38e4f9c43be75abe0edcd3d (diff) | |
| download | rust-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.cpp | 2 |
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()); |
