Skip to content

Commit

Permalink
Fix errors in other platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Sep 14, 2024
1 parent d7dfcf4 commit 4430b11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rust_crate/src/shutdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ impl Event {

/// Sets the flag to `true` and notifies all waiting threads.
/// This will wake up any threads or async tasks.
#[cfg(not(target_family = "wasm"))]
pub fn set(&self) {
let mut inner = match self.inner.lock() {
Ok(inner) => inner,
Expand All @@ -61,6 +62,7 @@ impl Event {
/// Clears the flag, setting it to `false`.
/// This does not affect any waiting threads, but subsequent calls to `wait` will
/// block until the flag is set again.
#[cfg(all(not(target_family = "wasm"), debug_assertions))]
pub fn clear(&self) {
let mut inner = match self.inner.lock() {
Ok(inner) => inner,
Expand All @@ -72,6 +74,7 @@ impl Event {
/// Blocks the current thread until the flag is set to `true`.
/// If the flag is already set, this method will return immediately. Otherwise, it
/// will block until `set` is called by another thread.
#[cfg(not(target_family = "wasm"))]
pub fn wait(&self) {
let event_blocking = EventBlocking::new(self.inner.clone(), self.condvar.clone());
event_blocking.wait();
Expand Down

0 comments on commit 4430b11

Please sign in to comment.