Skip to content

Commit 0c00a7b

Browse files
committed
Rename task_queue::lock function
1 parent 7cd732f commit 0c00a7b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/std/src/sys/pal/sgx/thread.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ mod task_queue {
5151
#[export_name = "_ZN16__rust_internals3std3sys3sgx6thread10TASK_QUEUEE"]
5252
static TASK_QUEUE: Mutex<Vec<Task>> = Mutex::new(Vec::new());
5353

54-
pub(super) fn lock() -> MutexGuard<'static, Vec<Task>> {
54+
pub(super) fn tasks() -> MutexGuard<'static, Vec<Task>> {
5555
TASK_QUEUE.lock().unwrap()
5656
}
5757
}
@@ -98,15 +98,15 @@ pub mod wait_notify {
9898
impl Thread {
9999
// unsafe: see thread::Builder::spawn_unchecked for safety requirements
100100
pub unsafe fn new(_stack: usize, p: Box<dyn FnOnce()>) -> io::Result<Thread> {
101-
let mut queue_lock = task_queue::lock();
101+
let mut tasks = task_queue::tasks();
102102
unsafe { usercalls::launch_thread()? };
103103
let (task, handle) = task_queue::Task::new(p);
104-
queue_lock.push(task);
104+
tasks.push(task);
105105
Ok(Thread(handle))
106106
}
107107

108108
pub(super) fn entry() -> JoinNotifier {
109-
let mut pending_tasks = task_queue::lock();
109+
let mut pending_tasks = task_queue::tasks();
110110
let task = rtunwrap!(Some, pending_tasks.pop());
111111
drop(pending_tasks); // make sure to not hold the task queue lock longer than necessary
112112
task.run()

0 commit comments

Comments
 (0)