Skip to content

Commit

Permalink
fix monitor executes coroutine bug (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
loongs-zhang authored Nov 8, 2024
2 parents 2c004cb + 3a96588 commit 540b816
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/src/syscall/unix/pthread_cond_timedwait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ impl<I: PthreadCondTimedwaitSyscall> PthreadCondTimedwaitSyscall
lock: *mut pthread_mutex_t,
abstime: *const timespec,
) -> c_int {
#[cfg(all(unix, feature = "preemptive"))]
if crate::monitor::Monitor::current().is_some() {
return self.inner.pthread_cond_timedwait(
fn_ptr,
cond,
lock,
abstime,
);
}
let abstimeout = if abstime.is_null() {
u64::MAX
} else {
Expand Down

0 comments on commit 540b816

Please sign in to comment.