mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibThreading: Create WorkerThread class run a single task concurrently
This class can be used to run a task in another thread, and allows the caller to wait for the task to complete to retrieve any error that may have occurred. Currently, it doesn't support functions returning a value on success, but with some template magic that should be possible. :^)
This commit is contained in:
parent
1fcac52e77
commit
ba5bf412e5
Notes:
sideshowbarker
2024-07-17 18:46:57 +09:00
Author: https://github.com/Zaggy1024
Commit: ba5bf412e5
Pull-request: https://github.com/SerenityOS/serenity/pull/18298
Reviewed-by: https://github.com/caoimhebyrne
Reviewed-by: https://github.com/gmta
4 changed files with 192 additions and 0 deletions
15
Userland/Libraries/LibThreading/Forward.h
Normal file
15
Userland/Libraries/LibThreading/Forward.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2019-2020, Sergey Bugaev <bugaevc@serenityos.org>
|
||||
* Copyright (c) 2021, Spencer Dixon <spencercdixon@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Threading {
|
||||
|
||||
template<typename ErrorType>
|
||||
class WorkerThread;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue