diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-09-19 18:48:39 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2020-09-19 18:48:39 +0200 |
| commit | 26d6081f1d1a2005be87bbe47f6fcda270cfd016 (patch) | |
| tree | fdd8ca869b18710d96899d2b5be49f7841308987 /library/std/src | |
| parent | b3aae050cd7e0c9a9eb6085bd49b02f67dc1396f (diff) | |
| download | rust-26d6081f1d1a2005be87bbe47f6fcda270cfd016.tar.gz rust-26d6081f1d1a2005be87bbe47f6fcda270cfd016.zip | |
Relax promises about condition variable.
This allows for futex or thread parking based implementations in the future.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/sync/condvar.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/library/std/src/sync/condvar.rs b/library/std/src/sync/condvar.rs index bc01c26a86a..7e2155dae6f 100644 --- a/library/std/src/sync/condvar.rs +++ b/library/std/src/sync/condvar.rs @@ -78,13 +78,9 @@ impl WaitTimeoutResult { /// and a mutex. The predicate is always verified inside of the mutex before /// determining that a thread must block. /// -/// Functions in this module will block the current **thread** of execution and -/// are bindings to system-provided condition variables where possible. Note -/// that this module places one additional restriction over the system condition -/// variables: each condvar can be used with precisely one mutex at runtime. Any -/// attempt to use multiple mutexes on the same condition variable will result -/// in a runtime panic. If this is not desired, then the unsafe primitives in -/// `sys` do not have this restriction but may result in undefined behavior. +/// Functions in this module will block the current **thread** of execution. +/// Note that any attempt to use multiple mutexes on the same condition +/// variable may result in a runtime panic. /// /// # Examples /// @@ -159,10 +155,8 @@ impl Condvar { /// /// # Panics /// - /// This function will [`panic!`] if it is used with more than one mutex - /// over time. Each condition variable is dynamically bound to exactly one - /// mutex to ensure defined behavior across platforms. If this functionality - /// is not desired, then unsafe primitives in `sys` are provided. + /// This function may [`panic!`] if it is used with more than one mutex + /// over time. /// /// [`notify_one`]: Self::notify_one /// [`notify_all`]: Self::notify_all |
