kernel: umtx: avoid notifying suspended processes

stub sys_prepare_to_suspend_process and sys_suspend_process
fix sys_osem_trywait on bad descriptor
This commit is contained in:
DH 2024-11-20 23:29:56 +03:00
parent 0da531a58e
commit 87c0cd7dad
3 changed files with 50 additions and 21 deletions

View file

@ -23,14 +23,12 @@ std::errc shared_cv::impl_wait(shared_mutex &mutex, unsigned _val,
result =
m_value.wait(_val, useTimeout ? std::chrono::microseconds(usec_timeout)
: std::chrono::microseconds::max());
bool spurious = result == std::errc::resource_unavailable_try_again ||
result == std::errc::interrupted;
bool spurious = result == std::errc::resource_unavailable_try_again;
// Cleanup
const auto old = m_value.fetch_op([&](unsigned &value) {
// Remove waiter if no signals
if ((value & ~c_waiter_mask) == 0) {
if (!spurious) {
value -= 1;
}