mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
Thread: Fix a regression introduced in 80a6df9022
Accidentally forgot to check the state parameter, which made this rather useless. Bug found, and cause identified by Andreas
This commit is contained in:
parent
53262cd08b
commit
4547a301c4
Notes:
sideshowbarker
2024-07-19 13:08:21 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/4547a301c4c Pull-request: https://github.com/SerenityOS/serenity/pull/345
@ -312,9 +312,14 @@ template<typename Callback>
|
||||
inline IterationDecision Thread::for_each_in_state(State state, Callback callback)
|
||||
{
|
||||
ASSERT_INTERRUPTS_DISABLED();
|
||||
auto new_callback = [=](Thread& thread) -> IterationDecision {
|
||||
if (thread.state() == state)
|
||||
return callback(thread);
|
||||
return IterationDecision::Continue;
|
||||
};
|
||||
if (is_runnable_state(state))
|
||||
return for_each_runnable(callback);
|
||||
return for_each_nonrunnable(callback);
|
||||
return for_each_runnable(new_callback);
|
||||
return for_each_nonrunnable(new_callback);
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
|
Loading…
Reference in New Issue
Block a user