Skip to content

Commit 9f6b96e

Browse files
committed
move the definition of thread priorities to hermit-abi
1 parent 6c80bdb commit 9f6b96e

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,9 +1372,9 @@ dependencies = [
13721372

13731373
[[package]]
13741374
name = "hermit-abi"
1375-
version = "0.1.9"
1375+
version = "0.1.10"
13761376
source = "registry+https://github.com/rust-lang/crates.io-index"
1377-
checksum = "0ebe6e23502442c4c9cd80fcb8bdf867dc5f4a9e9f1d882499fa49c5ed83e559"
1377+
checksum = "725cf19794cf90aa94e65050cb4191ff5d8fa87a498383774c47b332e3af952e"
13781378
dependencies = [
13791379
"compiler_builtins",
13801380
"libc",

src/libstd/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dlmalloc = { version = "0.1", features = ['rustc-dep-of-std'] }
4141
fortanix-sgx-abi = { version = "0.3.2", features = ['rustc-dep-of-std'] }
4242

4343
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_os = "hermit"))'.dependencies]
44-
hermit-abi = { version = "0.1.9", features = ['rustc-dep-of-std'] }
44+
hermit-abi = { version = "0.1.10", features = ['rustc-dep-of-std'] }
4545

4646
[target.wasm32-wasi.dependencies]
4747
wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features = false }

src/libstd/sys/hermit/thread.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![allow(dead_code)]
22

33
use crate::ffi::CStr;
4-
use crate::fmt;
54
use crate::io;
65
use crate::mem;
76
use crate::sys::hermit::abi;
@@ -12,28 +11,6 @@ use crate::sys_common::thread::*;
1211

1312
pub type Tid = abi::Tid;
1413

15-
/// Priority of a task
16-
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Clone, Copy)]
17-
pub struct Priority(u8);
18-
19-
impl Priority {
20-
pub const fn into(self) -> u8 {
21-
self.0
22-
}
23-
24-
pub const fn from(x: u8) -> Self {
25-
Priority(x)
26-
}
27-
}
28-
29-
impl fmt::Display for Priority {
30-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
31-
write!(f, "{}", self.0)
32-
}
33-
}
34-
35-
pub const NORMAL_PRIO: Priority = Priority::from(2);
36-
3714
pub struct Thread {
3815
tid: Tid,
3916
}
@@ -55,7 +32,7 @@ impl Thread {
5532
&mut tid as *mut Tid,
5633
thread_start,
5734
&*p as *const _ as *const u8 as usize,
58-
Priority::into(NORMAL_PRIO),
35+
abi::Priority::into(abi::NORMAL_PRIO),
5936
core_id,
6037
);
6138

0 commit comments

Comments
 (0)