orbis-kernel: unblock signals only on wait operations

implement sys_cpuset_getaffinity, sys_cpuset_setaffinity, sys_rtprio_thread
fix hang on sys_select
simplify sys_thr_*_ucontext
This commit is contained in:
DH 2024-11-13 21:53:05 +03:00
parent c19c70eb77
commit 9fbe1846c0
21 changed files with 675 additions and 236 deletions

View file

@ -15,9 +15,20 @@ std::errc shared_atomic32::wait_impl(std::uint32_t oldValue,
timeout.tv_sec = (usec_timeout_count / 1000'000);
}
bool unblock = (!useTimeout || usec_timeout.count() > 1000) &&
g_scopedUnblock != nullptr;
if (unblock) {
g_scopedUnblock(true);
}
int result = syscall(SYS_futex, this, FUTEX_WAIT, oldValue,
useTimeout ? &timeout : nullptr);
if (unblock) {
g_scopedUnblock(false);
}
if (result < 0) {
return static_cast<std::errc>(errno);
}