mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
LibCore: Add swift bindings for EventLoop as an Executor and Actor
This commit is contained in:
parent
3af63bc5a3
commit
c8787e6a9f
Notes:
github-actions[bot]
2025-03-16 03:52:13 +00:00
Author: https://github.com/ADKaster
Commit: c8787e6a9f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3880
10 changed files with 224 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <AK/Function.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/NonnullOwnPtr.h>
|
||||
#include <AK/Swift.h>
|
||||
#include <AK/Time.h>
|
||||
#include <LibCore/Event.h>
|
||||
#include <LibCore/Forward.h>
|
||||
|
@ -40,6 +41,10 @@ class ThreadEventQueue;
|
|||
// - Quit events, i.e. the event loop should exit.
|
||||
// Any event that the event loop needs to wait on or needs to repeatedly handle is stored in a handle, e.g. s_timers.
|
||||
class EventLoop {
|
||||
AK_MAKE_NONMOVABLE(EventLoop);
|
||||
AK_MAKE_NONCOPYABLE(EventLoop);
|
||||
|
||||
private:
|
||||
friend struct EventLoopPusher;
|
||||
|
||||
public:
|
||||
|
@ -90,7 +95,7 @@ public:
|
|||
|
||||
private:
|
||||
NonnullOwnPtr<EventLoopImplementation> m_impl;
|
||||
};
|
||||
} SWIFT_UNSAFE_REFERENCE;
|
||||
|
||||
void deferred_invoke(ESCAPING Function<void()>);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue