mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-09 10:04:41 +00:00
Kernel: Move some time related code from Scheduler into TimeManagement
Use the TimerQueue to expire blocking operations, which is one less thing the Scheduler needs to check on every iteration. Also, add a BlockTimeout class that will automatically handle relative or absolute timeouts as well as overriding timeouts (e.g. socket timeouts) more consistently. Also, rework the TimerQueue class to be able to fire events from any processor, which requires Timer to be RefCounted. Also allow creating id-less timers for use by blocking operations.
This commit is contained in:
@@ -74,7 +74,7 @@ auto AsyncDeviceRequest::wait(timeval* timeout) -> RequestWaitResult
|
||||
auto request_result = get_request_result();
|
||||
if (is_completed_result(request_result))
|
||||
return { request_result, Thread::BlockResult::NotBlocked };
|
||||
auto wait_result = Thread::current()->wait_on(m_queue, name(), timeout);
|
||||
auto wait_result = Thread::current()->wait_on(m_queue, name(), Thread::BlockTimeout(false, timeout));
|
||||
return { get_request_result(), wait_result };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user