Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions core/src/coroutine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,14 @@
.is_ok()
{
extern "C" fn sigvtalrm_handler<Param, Yield>(_: libc::c_int) {
if let Some(suspender) = suspender::Suspender::<Param, Yield>::current() {
suspender.cancel();
if let Ok(mut set) = SigSet::thread_get_mask() {

Check warning on line 150 in core/src/coroutine/mod.rs

View check run for this annotation

Codecov / codecov/patch

core/src/coroutine/mod.rs#L150

Added line #L150 was not covered by tests
//删除对SIGVTALRM信号的屏蔽,使信号处理函数即使在处理中,也可以再次进入信号处理函数
set.remove(Signal::SIGVTALRM);
set.thread_set_mask()
.expect("Failed to remove SIGVTALRM signal mask!");
if let Some(suspender) = suspender::Suspender::<Param, Yield>::current() {
suspender.cancel();
}

Check warning on line 157 in core/src/coroutine/mod.rs

View check run for this annotation

Codecov / codecov/patch

core/src/coroutine/mod.rs#L152-L157

Added lines #L152 - L157 were not covered by tests
}
}
// install SIGVTALRM signal handler
Expand Down
2 changes: 1 addition & 1 deletion open-coroutine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
_ = any_join!(task!(|_| 1, ()), task!(|_| 2, ()), task!(|_| 3, ()));
task!(
|_| {
println!("Try cancel!");
unreachable!("Try cancel!");

Check warning on line 380 in open-coroutine/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

open-coroutine/src/lib.rs#L380

Added line #L380 was not covered by tests
},
(),
)
Expand Down
Loading