mirror of
https://github.com/asterinas/asterinas.git
synced 2025-07-11 16:43:23 +00:00
Add a comment for UserMode
This commit is contained in:
@ -109,8 +109,10 @@ pub struct UserMode<'a> {
|
|||||||
context: UserContext,
|
context: UserContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
// An instance of `UserMode` is bound to the current task. So it cannot be [`Send`].
|
// An instance of `UserMode` is bound to the current task. So it must not be sent to other tasks.
|
||||||
impl<'a> !Send for UserMode<'a> {}
|
impl<'a> !Send for UserMode<'a> {}
|
||||||
|
// Note that implementing `!Sync` is unnecessary
|
||||||
|
// because entering the user space via `UserMode` requires taking a mutable reference.
|
||||||
|
|
||||||
impl<'a> UserMode<'a> {
|
impl<'a> UserMode<'a> {
|
||||||
/// Creates a new `UserMode`.
|
/// Creates a new `UserMode`.
|
||||||
|
Reference in New Issue
Block a user