about summary refs log tree commit diff
path: root/library/std/src/sys/unix/time.rs
AgeCommit message (Collapse)AuthorLines
2023-03-30Refactor glibc time64 support, riscv32 always has 64-bit `time_t`beetrees-14/+36
2023-02-28Add QNX Neutrino support to libstdFlorian Bartels-0/+22
Co-authored-by: gh-tr <troach@qnx.com>
2022-12-02std: cleanup timeouts in pthread condvarjoboet-0/+3
2022-11-20cfg(miri) no longer needed in sys/unix/time.rsRalf Jung-2/+2
2022-11-14macos, aarch64, and not(miri)Cameron-2/+2
2022-11-13just use `libc::clockid_t`Cameron-8/+3
2022-11-13Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targetsJoy-3/+15
2022-09-28Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`beetrees-13/+21
2022-07-20Library changes for Apple WatchOSVladimir Michael Eatwell-2/+2
2022-06-13Horizon OS STD supportMeziu-2/+3
Co-authored-by: Ian Chamberlain <ian.h.chamberlain@gmail.com> Co-authored-by: Mark Drobnak <mark.drobnak@gmail.com>
2022-05-11to_timespec could be unused by some targetsSébastien Marie-0/+1
2022-05-11openbsd: convert futex timeout managment to Timespec usageSébastien Marie-1/+1
2022-05-09Use Rust 2021 prelude in std itself.Mara Bos-2/+0
2022-05-06Share more unix SystemTime codeJosh Stone-101/+57
2022-05-06Use statx's 64-bit times on 32-bit linux-gnuJosh Stone-0/+8
2022-05-06Use __clock_gettime64 on 32-bit linux-gnuJosh Stone-0/+27
2022-05-06unix: always use 64-bit TimespecJosh Stone-62/+58
2022-04-28std: simplify UNIX parker timeoutsjoboet-2/+2
2022-04-01Use MaybeUninit for clock_gettime's timespec.Mara Bos-3/+4
2022-03-24Make Timespec available in sys::unix.Mara Bos-15/+13
2022-03-24Use FUTEX_WAIT_BITSET rather than FUTEX_WAIT on Linux.Mara Bos-0/+4
2022-02-13make Instant::{duration_since, elapsed, sub} saturating and remove workaroundsThe8472-19/+0
This removes all mutex/atomics based workarounds for non-monotonic clocks and makes the previously panicking methods saturating instead. Effectively this moves the monotonization from `Instant` construction to the comparisons. This has some observable effects, especially on platforms without monotonic clocks: * Incorrectly ordered Instant comparisons no longer panic. This may hide some programming errors until someone actually looks at the resulting `Duration` * `checked_duration_since` will now return `None` in more cases. Previously it only happened when one compared instants obtained in the wrong order or manually created ones. Now it also does on backslides. The upside is reduced complexity and lower overhead of `Instant::now`.
2021-09-04linux/aarch64 Now() should be actually_monotonic()Ali Saidi-0/+1
While issues have been seen on arm64 platforms the Arm architecture requires that the counter monotonically increases and that it must provide a uniform view of system time (e.g. it must not be possible for a core to receive a message from another core with a time stamp and observe time going backwards (ARM DDI 0487G.b D11.1.2). While there have been a few 64bit SoCs that have bugs (#49281, #56940) which cause time to not monotonically increase, these have been fixed in the Linux kernel and we shouldn't penalize all Arm SoCs for those who refuse to update their kernels: SUN50I_ERRATUM_UNKNOWN1 - Allwinner A64 / Pine A64 - fixed in 5.1 FSL_ERRATUM_A008585 - Freescale LS2080A/LS1043A - fixed in 4.10 HISILICON_ERRATUM_161010101 - Hisilicon 1610 - fixed in 4.11 ARM64_ERRATUM_858921 - Cortex A73 - fixed in 4.12 255a3f3e183 std: Force `Instant::now()` to be monotonic added a mutex to work around this problem and a small test program using glommio shows the majority of time spent acquiring and releasing this Mutex. 3914a7b0da8 tries to improve this, but actually makes it worse on big systems as for 128b atomics a ldxp/stxp pair (and successful loop) is required which is expensive as a lock and because of how the load/store-exclusives scale on large Arm systems is both unfair to threads and tends to go backwards in performance.
2021-08-10STD support for the ESP-IDF frameworkivmarkov-2/+2
2020-12-29Fix small typo in time commentBlackHoleFox-1/+1
2020-10-08Switch to using a single atomic and treating 0 as 'uninitialized'Thom Chiovoloni-16/+12
2020-10-08Fiddle with the commentsThom Chiovoloni-5/+5
2020-10-08Avoid SeqCst or static mut in mach_timebase_info cacheThom Chiovoloni-22/+36
2020-08-15std/sys/unix/time: make it easier for LLVM to optimize `Instant` subtraction.Eduard-Mihai Burtescu-8/+20
2020-07-27mv std libs to library/mark-0/+352