Skip to content

Commit 0be6791

Browse files
committed
enhance stability
1 parent 70f2837 commit 0be6791

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

hook/src/syscall/unix.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ macro_rules! impl_hook {
2323
std::mem::transmute(ptr)
2424
});
2525
let fn_ptr = once_cell::sync::Lazy::force(&$field_name);
26-
if $crate::hook() {
26+
if $crate::hook()
27+
|| open_coroutine_core::scheduler::SchedulableCoroutine::current().is_some()
28+
|| cfg!(feature = "ci")
29+
{
2730
return open_coroutine_core::syscall::$syscall(Some(fn_ptr), $($arg, )*);
2831
}
2932
(fn_ptr)($($arg),*)

hook/src/syscall/windows.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ macro_rules! impl_hook {
3636
open_coroutine_core::common::constants::SyscallName::$syscall
3737
)
3838
});
39-
if $crate::hook() {
39+
if $crate::hook()
40+
|| open_coroutine_core::scheduler::SchedulableCoroutine::current().is_some()
41+
|| cfg!(feature = "ci")
42+
{
4043
return open_coroutine_core::syscall::$syscall(Some(fn_ptr), $($arg),*);
4144
}
4245
(fn_ptr)($($arg),*)

0 commit comments

Comments
 (0)