std: replace generic thread parker with explicit no-op parker

This commit is contained in:
joboet
2022-12-11 13:01:29 +01:00
parent 4b34c7b766
commit 9622cdee1a
6 changed files with 17 additions and 129 deletions

View File

@@ -22,6 +22,7 @@ pub mod thread;
#[cfg(target_thread_local)]
pub mod thread_local_dtor;
pub mod thread_local_key;
pub mod thread_parking;
pub mod time;
mod common;

View File

@@ -0,0 +1,11 @@
use crate::pin::Pin;
use crate::time::Duration;
pub struct Parker {}
impl Parker {
pub unsafe fn new_in_place(_parker: *mut Parker) {}
pub unsafe fn park(self: Pin<&Self>) {}
pub unsafe fn park_timeout(self: Pin<&Self>, _dur: Duration) {}
pub fn unpark(self: Pin<&Self>) {}
}

View File

@@ -49,6 +49,8 @@ pub mod thread;
pub mod thread_local_dtor;
#[path = "../unsupported/thread_local_key.rs"]
pub mod thread_local_key;
#[path = "../unsupported/thread_parking.rs"]
pub mod thread_parking;
pub mod time;
#[path = "../unsupported/common.rs"]

View File

@@ -70,6 +70,8 @@ cfg_if::cfg_if! {
pub mod once;
#[path = "../unsupported/thread.rs"]
pub mod thread;
#[path = "../unsupported/thread_parking.rs"]
pub mod thread_parking;
}
}