1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +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:
Tom 2020-08-03 09:43:19 -06:00 committed by Andreas Kling
parent df52061cdb
commit f4a5c9b6c2
15 changed files with 60 additions and 77 deletions

View file

@ -146,7 +146,7 @@ int Process::sys$join_thread(int tid, void** exit_value)
// NOTE: pthread_join() cannot be interrupted by signals. Only by death.
for (;;) {
auto result = current_thread->block<Thread::JoinBlocker>(*thread, joinee_exit_value);
auto result = current_thread->block<Thread::JoinBlocker>(nullptr, *thread, joinee_exit_value);
if (result == Thread::BlockResult::InterruptedByDeath) {
// NOTE: This cleans things up so that Thread::finalize() won't
// get confused about a missing joiner when finalizing the joinee.