diff options
| author | joboet <jonasboettiger@icloud.com> | 2022-12-30 15:49:47 +0100 |
|---|---|---|
| committer | joboet <jonasboettiger@icloud.com> | 2022-12-30 15:49:47 +0100 |
| commit | 9abda03da69ee64625f2242cdaefa348bd0b48cd (patch) | |
| tree | a9e521cd6a0fbe80f4a88894100ce5076a4e6866 /library/std/src/sys/unix | |
| parent | 3076f4ec30632a063d0737bef589e1c4859ad23c (diff) | |
| download | rust-9abda03da69ee64625f2242cdaefa348bd0b48cd.tar.gz rust-9abda03da69ee64625f2242cdaefa348bd0b48cd.zip | |
std: rename `Parker::new` to `Parker::new_in_place`, add safe `Parker::new` constructor for SGX
Diffstat (limited to 'library/std/src/sys/unix')
| -rw-r--r-- | library/std/src/sys/unix/thread_parking/darwin.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/unix/thread_parking/pthread.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/unix/thread_parking/darwin.rs b/library/std/src/sys/unix/thread_parking/darwin.rs index 2f5356fe227..b709fada3b4 100644 --- a/library/std/src/sys/unix/thread_parking/darwin.rs +++ b/library/std/src/sys/unix/thread_parking/darwin.rs @@ -46,7 +46,7 @@ unsafe impl Sync for Parker {} unsafe impl Send for Parker {} impl Parker { - pub unsafe fn new(parker: *mut Parker) { + pub unsafe fn new_in_place(parker: *mut Parker) { let semaphore = dispatch_semaphore_create(0); assert!( !semaphore.is_null(), diff --git a/library/std/src/sys/unix/thread_parking/pthread.rs b/library/std/src/sys/unix/thread_parking/pthread.rs index 510168a010f..082d25e68f5 100644 --- a/library/std/src/sys/unix/thread_parking/pthread.rs +++ b/library/std/src/sys/unix/thread_parking/pthread.rs @@ -99,7 +99,7 @@ impl Parker { /// /// # Safety /// The constructed parker must never be moved. - pub unsafe fn new(parker: *mut Parker) { + pub unsafe fn new_in_place(parker: *mut Parker) { // Use the default mutex implementation to allow for simpler initialization. // This could lead to undefined behaviour when deadlocking. This is avoided // by not deadlocking. Note in particular the unlocking operation before any |
