Skip to content

Commit 78a16dd

Browse files
committed
Minor fixes
1 parent 4d64bc6 commit 78a16dd

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

‎src/condvar.rs‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,6 @@ impl Condvar {
380380
///
381381
/// Like `wait`, the lock specified will be re-acquired when this function
382382
/// returns, regardless of whether the timeout elapsed or not.
383-
///
384-
/// # Panics
385-
///
386-
/// Panics if the given `timeout` is so large that it can't be added to the current time.
387-
/// This panic is not possible if the crate is built with the `nightly` feature, then a too
388-
/// large `timeout` becomes equivalent to just calling `wait`.
389383
#[inline]
390384
pub fn wait_for<T: ?Sized>(
391385
&self,
@@ -556,14 +550,7 @@ mod tests {
556550
let _g = m2.lock();
557551
c2.notify_one();
558552
});
559-
// Non-nightly panics on too large timeouts. Nightly treats it as indefinite wait.
560-
let very_long_timeout = if cfg!(feature = "nightly") {
561-
Duration::from_secs(u64::max_value())
562-
} else {
563-
Duration::from_millis(u32::max_value() as u64)
564-
};
565-
566-
let timeout_res = c.wait_for(&mut g, very_long_timeout);
553+
let timeout_res = c.wait_for(&mut g, Duration::from_secs(u64::max_value()));
567554
assert!(!timeout_res.timed_out());
568555

569556
drop(g);

‎src/elision.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// http://opensource.org/licenses/MIT>, at your option. This file may not be
66
// copied, modified, or distributed except according to those terms.
77

8-
#[cfg(all(feature = "nightly", any(target_arch = "x86", target_arch = "x86_64")))]
8+
#[cfg(all(feature = "hardware-lock-elision", any(target_arch = "x86", target_arch = "x86_64")))]
99
use std::arch::asm;
1010
use std::sync::atomic::AtomicUsize;
1111

0 commit comments

Comments
 (0)