99
1010#define SWIFT_EXPORT_FROM (LIBRARY ) __attribute__((__visibility__("default")))
1111
12+ #define SWIFT_NONISOLATED_UNSAFE __attribute__((swift_attr("nonisolated(unsafe)")))
13+
1214/// A schedulable unit
1315/// Note that this type layout is a part of public ABI, so we expect this field layout won't break in the future versions.
1416/// Current implementation refers the `swift-5.5-RELEASE` implementation.
@@ -27,13 +29,13 @@ typedef SWIFT_CC(swift) void (*swift_task_enqueueGlobal_original)(
2729 Job * _Nonnull job );
2830
2931SWIFT_EXPORT_FROM (swift_Concurrency )
30- extern void * _Nullable swift_task_enqueueGlobal_hook ;
32+ extern void * _Nullable swift_task_enqueueGlobal_hook SWIFT_NONISOLATED_UNSAFE ;
3133
3234/// A hook to take over global enqueuing with delay.
3335typedef SWIFT_CC (swift ) void (* swift_task_enqueueGlobalWithDelay_original )(
3436 unsigned long long delay , Job * _Nonnull job );
3537SWIFT_EXPORT_FROM (swift_Concurrency )
36- extern void * _Nullable swift_task_enqueueGlobalWithDelay_hook ;
38+ extern void * _Nullable swift_task_enqueueGlobalWithDelay_hook SWIFT_NONISOLATED_UNSAFE ;
3739
3840typedef SWIFT_CC (swift ) void (* swift_task_enqueueGlobalWithDeadline_original )(
3941 long long sec ,
@@ -42,13 +44,13 @@ typedef SWIFT_CC(swift) void (*swift_task_enqueueGlobalWithDeadline_original)(
4244 long long tnsec ,
4345 int clock , Job * _Nonnull job );
4446SWIFT_EXPORT_FROM (swift_Concurrency )
45- extern void * _Nullable swift_task_enqueueGlobalWithDeadline_hook ;
47+ extern void * _Nullable swift_task_enqueueGlobalWithDeadline_hook SWIFT_NONISOLATED_UNSAFE ;
4648
4749/// A hook to take over main executor enqueueing.
4850typedef SWIFT_CC (swift ) void (* swift_task_enqueueMainExecutor_original )(
4951 Job * _Nonnull job );
5052SWIFT_EXPORT_FROM (swift_Concurrency )
51- extern void * _Nullable swift_task_enqueueMainExecutor_hook ;
53+ extern void * _Nullable swift_task_enqueueMainExecutor_hook SWIFT_NONISOLATED_UNSAFE ;
5254
5355/// A hook to override the entrypoint to the main runloop used to drive the
5456/// concurrency runtime and drain the main queue. This function must not return.
@@ -59,13 +61,13 @@ typedef SWIFT_CC(swift) void (*swift_task_asyncMainDrainQueue_original)();
5961typedef SWIFT_CC (swift ) void (* swift_task_asyncMainDrainQueue_override )(
6062 swift_task_asyncMainDrainQueue_original _Nullable original );
6163SWIFT_EXPORT_FROM (swift_Concurrency )
62- extern void * _Nullable swift_task_asyncMainDrainQueue_hook ;
64+ extern void * _Nullable swift_task_asyncMainDrainQueue_hook SWIFT_NONISOLATED_UNSAFE ;
6365
6466
6567/// MARK: - thread local storage
6668
6769extern _Thread_local void * _Nullable swjs_thread_local_event_loop ;
6870
69- extern _Thread_local void * _Nullable swjs_thread_local_task_executor_worker ;
71+ extern _Thread_local void * _Nullable swjs_thread_local_task_executor_worker SWIFT_NONISOLATED_UNSAFE ;
7072
7173#endif
0 commit comments