mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Kernel: Add a new block state for accept() on a blocking socket
Rather than asserting, which really ruins everyone's day.
This commit is contained in:
committed by
Andreas Kling
parent
79a6312c8f
commit
f2fdac789c
@@ -137,6 +137,18 @@ bool Scheduler::pick_next()
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
||||
if (thread.state() == Thread::BlockedAccept) {
|
||||
auto& description = *thread.m_blocked_description;
|
||||
auto& socket = *description.socket();
|
||||
|
||||
if (socket.can_accept()) {
|
||||
thread.unblock();
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
||||
if (thread.state() == Thread::BlockedSelect) {
|
||||
if (thread.m_select_has_timeout) {
|
||||
if (now_sec > thread.m_select_timeout.tv_sec || (now_sec == thread.m_select_timeout.tv_sec && now_usec >= thread.m_select_timeout.tv_usec)) {
|
||||
|
||||
Reference in New Issue
Block a user