]> git.lizzy.rs Git - rust.git/commit
std: directly use pthread in UNIX parker implementation
authorjoboet <jonasboettiger@icloud.com>
Mon, 25 Apr 2022 13:19:50 +0000 (15:19 +0200)
committerjoboet <jonasboettiger@icloud.com>
Mon, 25 Apr 2022 13:19:50 +0000 (15:19 +0200)
commit54daf496e2e957a9f69aa88bf6c42520a2dbfa02
tree3ecee0dc5e3b5f0e8c3a93ce4bd6ecb5eaf05a5f
parentb759b2218649016cc40e82bdd6d958e2277ff6d7
std: directly use pthread in UNIX parker implementation

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.
library/std/src/sys/unix/mod.rs
library/std/src/sys/unix/thread_parker.rs [new file with mode: 0644]
library/std/src/sys/windows/thread_parker.rs
library/std/src/sys_common/thread_parker/futex.rs
library/std/src/sys_common/thread_parker/generic.rs
library/std/src/sys_common/thread_parker/mod.rs
library/std/src/thread/mod.rs