Skip to content

Commit 26d6081

Browse files
committed
Relax promises about condition variable.
This allows for futex or thread parking based implementations in the future.
1 parent b3aae05 commit 26d6081

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

library/std/src/sync/condvar.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,9 @@ impl WaitTimeoutResult {
7878
/// and a mutex. The predicate is always verified inside of the mutex before
7979
/// determining that a thread must block.
8080
///
81-
/// Functions in this module will block the current **thread** of execution and
82-
/// are bindings to system-provided condition variables where possible. Note
83-
/// that this module places one additional restriction over the system condition
84-
/// variables: each condvar can be used with precisely one mutex at runtime. Any
85-
/// attempt to use multiple mutexes on the same condition variable will result
86-
/// in a runtime panic. If this is not desired, then the unsafe primitives in
87-
/// `sys` do not have this restriction but may result in undefined behavior.
81+
/// Functions in this module will block the current **thread** of execution.
82+
/// Note that any attempt to use multiple mutexes on the same condition
83+
/// variable may result in a runtime panic.
8884
///
8985
/// # Examples
9086
///
@@ -159,10 +155,8 @@ impl Condvar {
159155
///
160156
/// # Panics
161157
///
162-
/// This function will [`panic!`] if it is used with more than one mutex
163-
/// over time. Each condition variable is dynamically bound to exactly one
164-
/// mutex to ensure defined behavior across platforms. If this functionality
165-
/// is not desired, then unsafe primitives in `sys` are provided.
158+
/// This function may [`panic!`] if it is used with more than one mutex
159+
/// over time.
166160
///
167161
/// [`notify_one`]: Self::notify_one
168162
/// [`notify_all`]: Self::notify_all

0 commit comments

Comments
 (0)