Commit Graph

4 Commits

Author SHA1 Message Date
Konrad 'ktoso' Malawski
6872707574 [embedded][Concurrency] Further refine C-api boundary for isIsolating... 2025-04-29 22:29:26 +09:00
Konrad 'ktoso' Malawski
e1dc854f8f [Concurrency] Change isIsolatingCurrent... to return Bool?
This changes the isIsolatingCurrentContext function to return `Bool?`
and removes all the witness table trickery we did previously to detect
if it was implemented or not. This comes at a cost of trying to invoke
it always, before `checkIsolated`, but it makes for an simpler
implementation and more checkable even by third party Swift code which
may want to ask this question.

Along with the `withSerialExecutor` function, this now enables us to
check the isolation at runtime when we have an `any Actor` e.g. from
`#isolation`.

Updates SE-0471 according to
https://forums.swift.org/t/se-0471-improved-custom-serialexecutor-isolation-checking-for-concurrency-runtime/78834/
review discussions
2025-04-29 20:08:55 +09:00
Konrad `ktoso` Malawski
e056c63c89 [Concurrency] Implement isIsolatingCurrentContext requirement and mode (#79788) 2025-03-11 09:48:38 +09:00
Alastair Houghton
837513dc16 [Concurrency] Fix test failures, add struct layout checks.
We were missing a field in `SwiftJob`, which broke various things.  To
avoid that problem in future, this PR adds a set of static asserts to
check the layout of various structures and that we're using the same
values as well.

Also added some functions to the ABI, and fixed things so that if you
enable the debug logging the library still builds (there was an extra
`_` in `Actor.cpp` that caused a build failure).

Finally, renamed `Hooks.cpp` to `ConcurrencyHooks.cpp`.

rdar://135380149
2024-09-30 17:16:33 +01:00