std: rename Parker::new to Parker::new_in_place, add safe Parker::new constructor for SGX
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user