mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +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
22
Libraries/LibCore/EventSwift.mm
Normal file
22
Libraries/LibCore/EventSwift.mm
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Andrew Kaster <andrew@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/EventSwift.h>
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
# error "This file requires ARC"
|
||||
#endif
|
||||
|
||||
namespace Core {
|
||||
void deferred_invoke_block(EventLoop& event_loop, void (^invokee)(void))
|
||||
{
|
||||
event_loop.deferred_invoke([invokee = move(invokee)] {
|
||||
invokee();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue