about summary refs log tree commit diff
path: root/src/libstd/sync/condvar.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-818/+0
2020-07-16Rollup merge of #73269 - mzohreva:mz/sgx-wait-timeout, r=jethrogbManish Goregaokar-4/+0
Enable some timeouts in SGX platform This would partially resolve https://github.com/fortanix/rust-sgx/issues/31 cc @jethrogb and @Goirad
2020-06-12Enable some timeouts in SGX platformMohsen Zohrevandi-4/+0
This would partially resolve https://github.com/fortanix/rust-sgx/issues/31
2020-06-10Migrate to numeric associated constsLzu Tao-1/+0
2019-12-26Rename wait_until/wait_timeout_until to wait_while/white_timeout_whileMatt Brubeck-36/+32
2019-12-26Stabilize Condvar::wait_until and wait_timeout_untilMatt Brubeck-7/+2
2019-12-22Format the worldMark Rousskov-49/+48
2019-08-31Update sync condvar doc styleIvan Tham-2/+2
2019-07-24Use match ergonomics in Condvar documentationKevin W Matthews-18/+18
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-1/+1
2019-03-25SGX target: fix std unit testsJethro Beekman-0/+4
2019-03-11Resolved nits raised in review.Alexander Regueiro-6/+6
2019-03-11Improvements to comments in libstd, libcore, liballoc.Alexander Regueiro-6/+6
2019-02-28libstd => 2018Taiki Endo-13/+13
2019-02-10libs: doc commentsAlexander Regueiro-1/+1
2019-02-10tests: doc commentsAlexander Regueiro-4/+4
2018-12-25Remove licensesMark Rousskov-10/+0
2018-02-25Rollup merge of #47970 - vlovich:condvar_wait_until, r=dtolnaykennytm-2/+214
Add Condvar APIs not susceptible to spurious wake Provide wait_until and wait_timeout_until helper wrappers that aren't susceptible to spurious wake. Additionally wait_timeout_until makes it possible to more easily write code that waits for a fixed amount of time in face of spurious wakes since otherwise each user would have to do math on adjusting the duration. Implements #47960.
2018-02-20Fix doc compile errorVitali Lovich-1/+1
2018-02-17Fix tidy violationVitali Lovich-3/+5
2018-02-16Fix unit test compilationVitali Lovich-11/+17
Also fix some code snippets in documentation.
2018-02-15Fix condvar exampleGuillaume Gomez-2/+4
2018-02-13Misc fixesVitali Lovich-4/+4
Switch feature guards to unstable Add missing semicolon Remove mut that's no longer necessary
2018-02-12Fix wait_timeout valueVitali Lovich-1/+1
2018-02-05Simplify wait_timeout_until & fix condition typoVitali Lovich-8/+7
2018-02-02Review responseVitali Lovich-8/+10
Make condition closure accept mut T&. Clarify spurious wakeup documentation. Cleanup doc example code.
2018-02-02Fix typoVitali Lovich-1/+1
2018-02-02Add Condvar APIs not susceptible to spurious wakeVitali Lovich-2/+205
Provide wait_until and wait_timeout_until helper wrappers that aren't susceptible to spurious wake.
2017-06-15Fix condvar.wait(distant future) return immediately on OSXStepan Koltsov-15/+51
Fixes issue #37440: `pthread_cond_timedwait` on macOS Sierra seems to overflow `ts_sec` parameter and returns immediately. To work around this problem patch rounds timeout down to approximately 1000 years. Patch also fixes overflow when converting `u64` to `time_t`.
2017-05-20Correct some stability versionsOliver Middleton-1/+1
These were found by running tidy on stable versions of rust and finding features stabilised with the wrong version numbers.
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-9/+9
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-02-23Add missing urls and examples for Condvar docsGuillaume Gomez-16/+230
2017-02-05Rollup merge of #39393 - ollie27:stab_impls, r=alexcrichtonCorey Farwell-1/+1
Fix a few impl stability attributes The versions show up in rustdoc.
2017-02-04tiny doc wording changeSon-1/+1
2017-01-29Fix a few impl stability attributesOliver Middleton-1/+1
The versions show up in rustdoc.
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+8
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+4
2016-09-11Documentation of what does for each typeathulappadan-0/+1
2016-08-30Auto merge of #35048 - tmiasko:monotonic-wait-timeout, r=alexcrichtonbors-1/+13
Use monotonic time in condition variables. Configure condition variables to use monotonic time using pthread_condattr_setclock on systems where this is possible. This fixes the issue when thread waiting on condition variable is woken up too late when system time is moved backwards.
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-4/+0
2016-08-19Document that Condvar makes the best effort to use monotonic clock.Tomasz Miąsko-0/+8
2016-07-31Use monotonic time with condition variables.Tomasz Miąsko-1/+5
Configure condition variables to use monotonic time using pthread_condattr_setclock on systems where this is possible. This fixes the issue when thread waiting on condition variable is woken up too late when system time is moved backwards.
2016-07-12std: Clean out deprecated APIsAlex Crichton-296/+72
This primarily removes a lot of `sync::Static*` APIs and rejiggers the associated implementations. While doing this it was discovered that the `is_poisoned` method can actually result in a data race for the Mutex/RwLock primitives, so the inner `Cell<bool>` was changed to an `AtomicBool` to prevent the associated data race. Otherwise the usage/gurantees should be the same they were before.
2016-05-24std: Stabilize APIs for the 1.10 releaseAlex Crichton-0/+24
This commit applies the FCP decisions made by the libs team for the 1.10 cycle, including both new stabilizations and deprecations. Specifically, the list of APIs is: Stabilized: * `os::windows::fs::OpenOptionsExt::access_mode` * `os::windows::fs::OpenOptionsExt::share_mode` * `os::windows::fs::OpenOptionsExt::custom_flags` * `os::windows::fs::OpenOptionsExt::attributes` * `os::windows::fs::OpenOptionsExt::security_qos_flags` * `os::unix::fs::OpenOptionsExt::custom_flags` * `sync::Weak::new` * `Default for sync::Weak` * `panic::set_hook` * `panic::take_hook` * `panic::PanicInfo` * `panic::PanicInfo::payload` * `panic::PanicInfo::location` * `panic::Location` * `panic::Location::file` * `panic::Location::line` * `ffi::CStr::from_bytes_with_nul` * `ffi::CStr::from_bytes_with_nul_unchecked` * `ffi::FromBytesWithNulError` * `fs::Metadata::modified` * `fs::Metadata::accessed` * `fs::Metadata::created` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak` * `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key` * `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}` * `SocketAddr::is_unnamed` * `SocketAddr::as_pathname` * `UnixStream::connect` * `UnixStream::pair` * `UnixStream::try_clone` * `UnixStream::local_addr` * `UnixStream::peer_addr` * `UnixStream::set_read_timeout` * `UnixStream::set_write_timeout` * `UnixStream::read_timeout` * `UnixStream::write_Timeout` * `UnixStream::set_nonblocking` * `UnixStream::take_error` * `UnixStream::shutdown` * Read/Write/RawFd impls for `UnixStream` * `UnixListener::bind` * `UnixListener::accept` * `UnixListener::try_clone` * `UnixListener::local_addr` * `UnixListener::set_nonblocking` * `UnixListener::take_error` * `UnixListener::incoming` * RawFd impls for `UnixListener` * `UnixDatagram::bind` * `UnixDatagram::unbound` * `UnixDatagram::pair` * `UnixDatagram::connect` * `UnixDatagram::try_clone` * `UnixDatagram::local_addr` * `UnixDatagram::peer_addr` * `UnixDatagram::recv_from` * `UnixDatagram::recv` * `UnixDatagram::send_to` * `UnixDatagram::send` * `UnixDatagram::set_read_timeout` * `UnixDatagram::set_write_timeout` * `UnixDatagram::read_timeout` * `UnixDatagram::write_timeout` * `UnixDatagram::set_nonblocking` * `UnixDatagram::take_error` * `UnixDatagram::shutdown` * RawFd impls for `UnixDatagram` * `{BTree,Hash}Map::values_mut` * `<[_]>::binary_search_by_key` Deprecated: * `StaticCondvar` - this, and all other static synchronization primitives below, are usable today through the lazy-static crate on stable Rust today. Additionally, we'd like the non-static versions to be directly usable in a static context one day, so they're unlikely to be the final forms of the APIs in any case. * `CONDVAR_INIT` * `StaticMutex` * `MUTEX_INIT` * `StaticRwLock` * `RWLOCK_INIT` * `iter::Peekable::is_empty` Closes #27717 Closes #27720 cc #27784 (but encode methods still exist) Closes #30014 Closes #30425 Closes #30449 Closes #31190 Closes #31399 Closes #31767 Closes #32111 Closes #32281 Closes #32312 Closes #32551 Closes #33018
2016-04-15Implement `Default` for more types in the standard libraryTobias Bucher-0/+7
Also add `Hash` to `std::cmp::Ordering` and most possible traits to `fmt::Error`.
2016-03-12std: Clean out deprecated APIsAlex Crichton-49/+4
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-0/+3
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
2016-02-01docs: Standardize on 'Errors' header in std docsKamal Marhubi-1/+1
2015-12-29Fix warnings when compiling stdlib with --testFlorian Hahn-3/+3
2015-11-20Rename #[deprecated] to #[rustc_deprecated]Vadim Petrochenkov-2/+3