mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Net: Merge Thread::wait_for_connect into LocalSocket (as the only place that uses it)
Also do this more like other blockers, don't call yield ourselves, as block will do that for us.
This commit is contained in:
committed by
Andreas Kling
parent
833d444cd8
commit
96de90ceef
@@ -513,20 +513,6 @@ Thread* Thread::clone(Process& process)
|
||||
return clone;
|
||||
}
|
||||
|
||||
KResult Thread::wait_for_connect(FileDescription& description)
|
||||
{
|
||||
ASSERT(description.is_socket());
|
||||
auto& socket = *description.socket();
|
||||
if (socket.is_connected())
|
||||
return KSuccess;
|
||||
if (block<Thread::ConnectBlocker>(description) == Thread::BlockResult::InterruptedBySignal)
|
||||
return KResult(-EINTR);
|
||||
Scheduler::yield();
|
||||
if (!socket.is_connected())
|
||||
return KResult(-ECONNREFUSED);
|
||||
return KSuccess;
|
||||
}
|
||||
|
||||
void Thread::initialize()
|
||||
{
|
||||
g_runnable_threads = new SchedulerThreadList;
|
||||
|
||||
Reference in New Issue
Block a user