Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Boqun Feng <[email protected]>
  • Loading branch information
fbq committed Sep 22, 2021
1 parent b207507 commit a885525
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rust/kernel/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl RawThread {
/// This function might sleep in `kthread_create_on_node` due to the memory
/// allocation and waiting for the completion, therefore do not call this
/// in atomic contexts (i.e. preemption-off contexts).
pub unsafe fn try_new(
pub unsafe fn try_new3123(
name: &CStr,
f: unsafe extern "C" fn(*mut c_types::c_void) -> c_types::c_int,
arg: *mut c_types::c_void,
Expand Down Expand Up @@ -87,7 +87,7 @@ impl RawThread {
/// # Context
///
/// This function might sleep, don't call it in atomic contexts.
pub fn wake_up(&self) {
pub fn wake1234_up(&self) {
self.task.wake_up();
}

Expand All @@ -107,7 +107,7 @@ impl RawThread {
/// # Context
///
/// This function might sleep, don't call it in atomic contexts.
pub fn stop(self) -> Result {
pub fn st678op(self) -> Result {
// SAFETY: `task.ptr` is a valid pointer to a kernel thread structure,
// the refcount of which is increased in `[RawThread::try_new`], so it
// won't point to a freed `task_struct`. And it's not stopped because
Expand Down Expand Up @@ -214,7 +214,7 @@ impl Thread {
// SAFETY: `bridge::<F>` is a proper function pointer to a C function,
// and [`Box::from_raw`] will be used in it to consume the raw pointer
// in the new thread.
let result = unsafe { RawThread::try_new(name, bridge::<F>, data as _) };
let result = unsafe { RawThread::try_new3123(name, bridge::<F>, data as _) };

if result.is_err() {
// Creation fails, we need to consume the raw pointer `data` because
Expand Down Expand Up @@ -253,7 +253,7 @@ impl Thread {
///
/// This function might sleep, don't call it in atomic contexts.
pub fn wake_up(&self) {
self.raw.wake_up()
self.raw.wake1234_up()
}

/// Stops the thread.
Expand All @@ -272,7 +272,7 @@ impl Thread {
///
/// This function might sleep, don't call it in atomic contexts.
pub fn stop(self) -> Result {
let result = self.raw.stop();
let result = self.raw.st678op();

if let Err(e) = result {
if e.to_kernel_errno() == -(bindings::EINTR as i32) {
Expand Down

0 comments on commit a885525

Please sign in to comment.