Skip to content

Commit c032d6f

Browse files
committed
std: Stabilize the sync_poison feature
These accessor/constructor methods for a `PoisonError` are quite standard for a wrapper type and enable manipulation of the underlying type.
1 parent 68b628b commit c032d6f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/libstd/sync/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl<T: ?Sized> Mutex<T> {
238238
/// time. You should not trust a `false` value for program correctness
239239
/// without additional synchronization.
240240
#[inline]
241-
#[unstable(feature = "sync_poison")]
241+
#[stable(feature = "sync_poison", since = "1.2.0")]
242242
pub fn is_poisoned(&self) -> bool {
243243
self.inner.poison.get()
244244
}

src/libstd/sync/rwlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl<T: ?Sized> RwLock<T> {
253253
/// time. You should not trust a `false` value for program correctness
254254
/// without additional synchronization.
255255
#[inline]
256-
#[unstable(feature = "sync_poison")]
256+
#[stable(feature = "sync_poison", since = "1.2.0")]
257257
pub fn is_poisoned(&self) -> bool {
258258
self.inner.poison.get()
259259
}

src/libstd/sys/common/poison.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,24 +120,24 @@ impl<T: Send + Reflect> Error for PoisonError<T> {
120120

121121
impl<T> PoisonError<T> {
122122
/// Creates a `PoisonError`.
123-
#[unstable(feature = "sync_poison")]
123+
#[stable(feature = "sync_poison", since = "1.2.0")]
124124
pub fn new(guard: T) -> PoisonError<T> {
125125
PoisonError { guard: guard }
126126
}
127127

128128
/// Consumes this error indicating that a lock is poisoned, returning the
129129
/// underlying guard to allow access regardless.
130-
#[unstable(feature = "sync_poison")]
130+
#[stable(feature = "sync_poison", since = "1.2.0")]
131131
pub fn into_inner(self) -> T { self.guard }
132132

133133
/// Reaches into this error indicating that a lock is poisoned, returning a
134134
/// reference to the underlying guard to allow access regardless.
135-
#[unstable(feature = "sync_poison")]
135+
#[stable(feature = "sync_poison", since = "1.2.0")]
136136
pub fn get_ref(&self) -> &T { &self.guard }
137137

138138
/// Reaches into this error indicating that a lock is poisoned, returning a
139139
/// mutable reference to the underlying guard to allow access regardless.
140-
#[unstable(feature = "sync_poi")]
140+
#[stable(feature = "sync_poison", since = "1.2.0")]
141141
pub fn get_mut(&mut self) -> &mut T { &mut self.guard }
142142
}
143143

0 commit comments

Comments
 (0)