diff options
| author | Steven Fackler <sfackler@gmail.com> | 2015-03-17 23:05:44 -0700 |
|---|---|---|
| committer | Steven Fackler <sfackler@gmail.com> | 2015-03-17 23:05:44 -0700 |
| commit | 2e8e8ab564891c3d2ffeeb0f8e1a4e850866f74f (patch) | |
| tree | 6975fbcaa159ab191a8518d261d2c7d93283ef90 /src/libstd | |
| parent | 1ae32decb87e3275ce955383a5c71e5c784a0216 (diff) | |
| download | rust-2e8e8ab564891c3d2ffeeb0f8e1a4e850866f74f.tar.gz rust-2e8e8ab564891c3d2ffeeb0f8e1a4e850866f74f.zip | |
Ignore stdio mutex poison state
Nothing inside of the read/write interface itself can panic, so any poison must have been the result of user code which the lock isn't protecting.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/stdio.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 75d047d5c9c..615607eed1b 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -146,7 +146,7 @@ impl Stdin { /// accessing the underlying data. #[stable(feature = "rust1", since = "1.0.0")] pub fn lock(&self) -> StdinLock { - StdinLock { inner: self.inner.lock().unwrap() } + StdinLock { inner: self.inner.lock().unwrap_or_else(|e| e.into_inner()) } } /// Locks this handle and reads a line of input into the specified buffer. @@ -249,7 +249,7 @@ impl Stdout { /// returned guard also implements the `Write` trait for writing data. #[stable(feature = "rust1", since = "1.0.0")] pub fn lock(&self) -> StdoutLock { - StdoutLock { inner: self.inner.lock().unwrap() } + StdoutLock { inner: self.inner.lock().unwrap_or_else(|e| e.into_inner()) } } } @@ -319,7 +319,7 @@ impl Stderr { /// returned guard also implements the `Write` trait for writing data. #[stable(feature = "rust1", since = "1.0.0")] pub fn lock(&self) -> StderrLock { - StderrLock { inner: self.inner.lock().unwrap() } + StderrLock { inner: self.inner.lock().unwrap_or_else(|e| e.into_inner()) } } } |
