Move Tid from Thread to PosixThread

This commit is contained in:
Jianfeng Jiang
2024-09-12 04:48:33 +00:00
committed by Tate, Hongliang Tian
parent ceb6e2b242
commit 81b0f265b5
21 changed files with 90 additions and 86 deletions

View File

@ -13,6 +13,14 @@ use crate::{
thread::{Thread, Tid},
};
pub trait PosixThreadExt {
/// Returns the thread id.
///
/// # Panics
///
/// If the thread is not posix thread, this method will panic.
fn tid(&self) -> Tid {
self.as_posix_thread().unwrap().tid()
}
fn as_posix_thread(&self) -> Option<&PosixThread>;
#[allow(clippy::too_many_arguments)]
fn new_posix_thread_from_executable(