mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
Kernel: Consolidate timeout logic
Allow passing in an optional timeout to Thread::block and move the timeout check out of Thread::Blocker. This way all Blockers implicitly support timeouts and don't need to implement it themselves. Do however allow them to override timeouts (e.g. for sockets).
This commit is contained in:
parent
df52061cdb
commit
f4a5c9b6c2
15 changed files with 60 additions and 77 deletions
|
@ -48,7 +48,7 @@ KResultOr<siginfo_t> Process::do_waitid(idtype_t idtype, int id, int options)
|
|||
return KResult(-EINVAL);
|
||||
}
|
||||
|
||||
if (Thread::current()->block<Thread::WaitBlocker>(options, waitee_pid).was_interrupted())
|
||||
if (Thread::current()->block<Thread::WaitBlocker>(nullptr, options, waitee_pid).was_interrupted())
|
||||
return KResult(-EINTR);
|
||||
|
||||
ScopedSpinLock lock(g_processes_lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue