about summary refs log tree commit diff
path: root/library/std/src/sys/windows/thread_parker.rs
AgeCommit message (Collapse)AuthorLines
2022-12-29std: unify id-based thread parking implementationsjoboet-253/+0
2022-08-18Windows: Load synch functions togetherChris Denton-15/+12
Attempt to load all the required sync functions and fail if any one of them fails. This reintroduces a macro for optional loading of functions but keeps it separate from the fallback macro rather than having that do two different jobs.
2022-08-04Remove Windows function preloadingChris Denton-15/+16
2022-05-09Use Rust 2021 prelude in std itself.Mara Bos-1/+0
2022-04-25std: directly use pthread in UNIX parker implementationjoboet-7/+13
Mutex and Condvar are being replaced by more efficient implementations, which need thread parking themselves (see #93740). Therefore use the pthread synchronization primitives directly. Also, avoid allocating because the Parker struct is being placed in an Arc anyways.
2022-03-29Make the stdlib largely conform to strict provenance.Aria Beingessner-6/+6
Some things like the unwinders and system APIs are not fully conformant, this only covers a lot of low-hanging fruit.
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-1/+1
This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored).
2021-12-14Fix a bunch of typosFrank Steffahn-1/+1
2021-01-29Resolve DLL imports at CRT startup, not on demandArlie Davis-6/+6
On Windows, libstd uses GetProcAddress to locate some DLL imports, so that libstd can run on older versions of Windows. If a given DLL import is not present, then libstd uses other behavior (such as fallback implementations). This commit uses a feature of the Windows CRT to do these DLL imports during module initialization, before main() (or DllMain()) is called. This is the ideal time to resolve imports, because the module is effectively single-threaded at that point; no other threads can touch the data or code of the module that is being initialized. This avoids several problems. First, it makes the cost of performing the DLL import lookups deterministic. Right now, the DLL imports are done on demand, which means that application threads _might_ have to do the DLL import during some time-sensitive operation. This is a small source of unpredictability. Since threads can race, it's even possible to have more than one thread running the same redundant DLL lookup. This commit also removes using the heap to allocate strings, during the DLL lookups.
2020-12-22Update library/std/src/sys/windows/thread_parker.rsLinus Färnstrand-1/+1
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2020-12-22Fix compare_and_swap in Windows thread_parkerLinus Färnstrand-1/+1
2020-10-06Formatting.Mara Bos-1/+2
2020-10-06Add comment documenting NtWaitForKeyedEvent's timeout interpretation.Mara Bos-2/+4
2020-10-06Add documentation to Windows thread parker implementation.Mara Bos-1/+60
2020-10-06Fix typos in comments.Mara Bos-2/+2
2020-10-06Improve windows thread parker.Mara Bos-24/+34
- Clarify memory ordering and spurious wakeups.
2020-10-06Add fast futex-based thread parker for Windows.Mara Bos-0/+178