mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:27:35 +00:00
LibCore: Add a class for thread-safe promises
Since the existing Promise class is designed with deferred tasks on the main thread only, we need a new class that will ensure we can handle promises that are resolved/rejected off the main thread. This new class ensures that the callbacks are only called on the same thread that the promise is fulfilled from. If the callbacks are not set before the thread tries to fulfill the promise, it will spin until they are so that they will run on that thread.
This commit is contained in:
parent
8626404ddb
commit
fe672989a9
7 changed files with 321 additions and 4 deletions
|
@ -36,6 +36,8 @@ class ProcessStatisticsReader;
|
|||
class Socket;
|
||||
template<typename Result, typename TError = AK::Error>
|
||||
class Promise;
|
||||
template<typename Result, typename TError = AK::Error>
|
||||
class ThreadedPromise;
|
||||
class SocketAddress;
|
||||
class TCPServer;
|
||||
class TCPSocket;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue