mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 08:53:29 +00:00
Rename (Posix)ThreadExt
to As(Posix)Thread
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
9233d1cdbb
commit
e6c613f538
@ -162,13 +162,13 @@ impl Thread {
|
||||
}
|
||||
}
|
||||
|
||||
/// An extension trait for [`Thread`]-like types.
|
||||
pub trait ThreadExt {
|
||||
/// A trait to provide the `as_thread` method for tasks.
|
||||
pub trait AsThread {
|
||||
/// Returns the associated [`Thread`].
|
||||
fn as_thread(&self) -> Option<&Arc<Thread>>;
|
||||
}
|
||||
|
||||
impl ThreadExt for Task {
|
||||
impl AsThread for Task {
|
||||
fn as_thread(&self) -> Option<&Arc<Thread>> {
|
||||
self.data().downcast_ref::<Arc<Thread>>()
|
||||
}
|
||||
|
Reference in New Issue
Block a user