Skip to content

Commit 540b816

Browse files
authored
fix monitor executes coroutine bug (#319)
2 parents 2c004cb + 3a96588 commit 540b816

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/src/syscall/unix/pthread_cond_timedwait.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ impl<I: PthreadCondTimedwaitSyscall> PthreadCondTimedwaitSyscall
6060
lock: *mut pthread_mutex_t,
6161
abstime: *const timespec,
6262
) -> c_int {
63+
#[cfg(all(unix, feature = "preemptive"))]
64+
if crate::monitor::Monitor::current().is_some() {
65+
return self.inner.pthread_cond_timedwait(
66+
fn_ptr,
67+
cond,
68+
lock,
69+
abstime,
70+
);
71+
}
6372
let abstimeout = if abstime.is_null() {
6473
u64::MAX
6574
} else {

0 commit comments

Comments
 (0)