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

@ -76,7 +76,7 @@ pub fn sys_timer_create(
// Send a signal to the specified thread when the timer is expired.
SigNotify::SIGEV_THREAD_ID => {
let tid = sig_event.sigev_un.read_tid() as u32;
let thread = thread_table::get_thread(tid).ok_or_else(|| {
let thread = thread_table::get_posix_thread(tid).ok_or_else(|| {
Error::with_message(Errno::EINVAL, "target thread does not exist")
})?;
let posix_thread = thread.as_posix_thread().unwrap();
@ -132,7 +132,7 @@ pub fn sys_timer_create(
}
}
DynamicClockIdInfo::Tid(tid, clock_type) => {
let thread = thread_table::get_thread(tid)
let thread = thread_table::get_posix_thread(tid)
.ok_or_else(|| Error::with_message(Errno::EINVAL, "invalid clock id"))?;
let posix_thread = thread.as_posix_thread().unwrap();
match clock_type {