use new interface to initialize Condvar

HermitCore introduce a new interface to intialize conditional variables.
Consequently, minor changes are required to support this interface.
This commit is contained in:
Stefan Lankes 2020-05-17 23:49:18 +02:00
parent 09739c22db
commit 06d692febd
3 changed files with 7 additions and 7 deletions

View File

@ -1439,9 +1439,9 @@ dependencies = [
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.1.12" version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4" checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71"
dependencies = [ dependencies = [
"compiler_builtins", "compiler_builtins",
"libc", "libc",

View File

@ -41,7 +41,7 @@ dlmalloc = { version = "0.1", features = ['rustc-dep-of-std'] }
fortanix-sgx-abi = { version = "0.3.2", features = ['rustc-dep-of-std'] } fortanix-sgx-abi = { version = "0.3.2", features = ['rustc-dep-of-std'] }
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_os = "hermit"))'.dependencies] [target.'cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_os = "hermit"))'.dependencies]
hermit-abi = { version = "0.1.12", features = ['rustc-dep-of-std'] } hermit-abi = { version = "0.1.13", features = ['rustc-dep-of-std'] }
[target.wasm32-wasi.dependencies] [target.wasm32-wasi.dependencies]
wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features = false } wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features = false }

View File

@ -9,12 +9,13 @@ pub struct Condvar {
impl Condvar { impl Condvar {
pub const fn new() -> Condvar { pub const fn new() -> Condvar {
Condvar { identifier: 0 } Condvar {
identifier: 0,
}
} }
#[inline]
pub unsafe fn init(&mut self) { pub unsafe fn init(&mut self) {
// nothing to do let _ = abi::init_queue(self.id());
} }
pub unsafe fn notify_one(&self) { pub unsafe fn notify_one(&self) {
@ -50,7 +51,6 @@ impl Condvar {
ret ret
} }
#[inline]
pub unsafe fn destroy(&self) { pub unsafe fn destroy(&self) {
let _ = abi::destroy_queue(self.id()); let _ = abi::destroy_queue(self.id());
} }