1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:45:07 +00:00

Kernel: Propagate OOM conditions out of sys$futex

This commit is contained in:
Idan Horowitz 2022-07-13 09:29:51 +03:00 committed by Andreas Kling
parent 364f6a9bf0
commit 55c7496200
4 changed files with 20 additions and 21 deletions

View file

@ -30,7 +30,7 @@ bool FutexQueue::should_add_blocker(Thread::Blocker& b, void*)
return true;
}
u32 FutexQueue::wake_n_requeue(u32 wake_count, Function<FutexQueue*()> const& get_target_queue, u32 requeue_count, bool& is_empty, bool& is_empty_target)
ErrorOr<u32> FutexQueue::wake_n_requeue(u32 wake_count, Function<ErrorOr<FutexQueue*>()> const& get_target_queue, u32 requeue_count, bool& is_empty, bool& is_empty_target)
{
is_empty_target = false;
SpinlockLocker lock(m_lock);
@ -55,7 +55,7 @@ u32 FutexQueue::wake_n_requeue(u32 wake_count, Function<FutexQueue*()> const& ge
if (requeue_count > 0) {
auto blockers_to_requeue = do_take_blockers(requeue_count);
if (!blockers_to_requeue.is_empty()) {
if (auto* target_futex_queue = get_target_queue()) {
if (auto* target_futex_queue = TRY(get_target_queue())) {
dbgln_if(FUTEXQUEUE_DEBUG, "FutexQueue @ {}: wake_n_requeue requeueing {} blockers to {}", this, blockers_to_requeue.size(), target_futex_queue);
// While still holding m_lock, notify each blocker