diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-20 18:54:31 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-21 16:36:57 -0700 |
| commit | fdf935a5249edd0be0f14385a099963e43c7a29b (patch) | |
| tree | 29511557c2c812534477934db9e1be4da6d219e8 /src/libnative | |
| parent | 54f6eacf34c1ec368750051832aba2735fbf0880 (diff) | |
| download | rust-fdf935a5249edd0be0f14385a099963e43c7a29b.tar.gz rust-fdf935a5249edd0be0f14385a099963e43c7a29b.zip | |
std,green: Mark some queue types as NoShare
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/io/net.rs | 4 | ||||
| -rw-r--r-- | src/libnative/io/pipe_unix.rs | 2 | ||||
| -rw-r--r-- | src/libnative/io/pipe_win32.rs | 16 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index a67d0439dbf..8bd8bc71a49 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -326,7 +326,7 @@ impl TcpStream { fn lock_nonblocking<'a>(&'a self) -> Guard<'a> { let ret = Guard { fd: self.fd(), - guard: unsafe { (*self.inner.get()).lock.lock() }, + guard: unsafe { self.inner.lock.lock() }, }; assert!(util::set_nonblocking(self.fd(), true).is_ok()); ret @@ -597,7 +597,7 @@ impl UdpSocket { fn lock_nonblocking<'a>(&'a self) -> Guard<'a> { let ret = Guard { fd: self.fd(), - guard: unsafe { (*self.inner.get()).lock.lock() }, + guard: unsafe { self.inner.lock.lock() }, }; assert!(util::set_nonblocking(self.fd(), true).is_ok()); ret diff --git a/src/libnative/io/pipe_unix.rs b/src/libnative/io/pipe_unix.rs index 8742fc58af1..a53a58b6cec 100644 --- a/src/libnative/io/pipe_unix.rs +++ b/src/libnative/io/pipe_unix.rs @@ -138,7 +138,7 @@ impl UnixStream { fn lock_nonblocking<'a>(&'a self) -> net::Guard<'a> { let ret = net::Guard { fd: self.fd(), - guard: self.inner.lock.lock(), + guard: unsafe { self.inner.lock.lock() }, }; assert!(util::set_nonblocking(self.fd(), true).is_ok()); ret diff --git a/src/libnative/io/pipe_win32.rs b/src/libnative/io/pipe_win32.rs index c90c3824bba..c9dbdc8331b 100644 --- a/src/libnative/io/pipe_win32.rs +++ b/src/libnative/io/pipe_win32.rs @@ -320,11 +320,11 @@ impl UnixStream { fn handle(&self) -> libc::HANDLE { self.inner.handle } fn read_closed(&self) -> bool { - unsafe { (*self.inner.get()).read_closed.load(atomics::SeqCst) } + self.inner.read_closed.load(atomics::SeqCst) } fn write_closed(&self) -> bool { - unsafe { (*self.inner.get()).write_closed.load(atomics::SeqCst) } + self.inner.write_closed.load(atomics::SeqCst) } fn cancel_io(&self) -> IoResult<()> { @@ -353,7 +353,7 @@ impl rtio::RtioPipe for UnixStream { // acquire the lock. // // See comments in close_read() about why this lock is necessary. - let guard = unsafe { (*self.inner.get()).lock.lock() }; + let guard = unsafe { self.inner.lock.lock() }; if self.read_closed() { return Err(io::standard_error(io::EndOfFile)) } @@ -429,7 +429,7 @@ impl rtio::RtioPipe for UnixStream { // going after we woke up. // // See comments in close_read() about why this lock is necessary. - let guard = unsafe { (*self.inner.get()).lock.lock() }; + let guard = unsafe { self.inner.lock.lock() }; if self.write_closed() { return Err(io::standard_error(io::BrokenPipe)) } @@ -514,15 +514,15 @@ impl rtio::RtioPipe for UnixStream { // close_read() between steps 1 and 2. By atomically executing steps 1 // and 2 with a lock with respect to close_read(), we're guaranteed that // no thread will erroneously sit in a read forever. - let _guard = unsafe { (*self.inner.get()).lock.lock() }; - unsafe { (*self.inner.get()).read_closed.store(true, atomics::SeqCst) } + let _guard = unsafe { self.inner.lock.lock() }; + self.inner.read_closed.store(true, atomics::SeqCst); self.cancel_io() } fn close_write(&mut self) -> IoResult<()> { // see comments in close_read() for why this lock is necessary - let _guard = unsafe { (*self.inner.get()).lock.lock() }; - unsafe { (*self.inner.get()).write_closed.store(true, atomics::SeqCst) } + let _guard = unsafe { self.inner.lock.lock() }; + self.inner.write_closed.store(true, atomics::SeqCst); self.cancel_io() } |
