orbis: implement initial guest signals support

This commit is contained in:
DH 2025-09-21 08:46:28 +03:00
parent 36b9e969c2
commit 70fa577a7b
12 changed files with 239 additions and 51 deletions

View file

@ -19,18 +19,28 @@ std::errc shared_atomic32::wait_impl(std::uint32_t oldValue,
g_scopedUnblock != nullptr;
if (unblock) {
g_scopedUnblock(true);
if (!g_scopedUnblock(true)) {
return std::errc::interrupted;
}
}
int result = syscall(SYS_futex, this, FUTEX_WAIT, oldValue,
useTimeout ? &timeout : nullptr);
auto errorCode = result < 0 ? static_cast<std::errc>(errno) : std::errc{};
if (unblock) {
g_scopedUnblock(false);
if (!g_scopedUnblock(false)) {
if (result < 0) {
return std::errc::interrupted;
}
return {};
}
}
if (result < 0) {
return static_cast<std::errc>(errno);
return errorCode;
}
return {};