Commit Graph

7 Commits

Author SHA1 Message Date
Alastair Houghton
8b15b05c63 Revert "[Concurrency] Provide a Swift interface for custom main and global executors." 2025-03-22 02:38:11 -07:00
Alastair Houghton
090c375b7b [Concurrency] Swift interface for custom main and global executors.
Reorganise the Concurrency code so that it's possible to completely
implement executors (both main and global) in Swift.

Provide API to choose the desired executors for your application.

Also make `Task.Sleep` wait using the current executor, not the global
executor, and expose APIs on `Clock` to allow for conversion between
time bases.

rdar://141348916
2025-03-13 13:34:41 +00:00
Konrad `ktoso` Malawski
e056c63c89 [Concurrency] Implement isIsolatingCurrentContext requirement and mode (#79788) 2025-03-11 09:48:38 +09:00
Kuba Mracek
4c58842f7a [Concurrency] Fix typo (Impll->Impl) in NonDispatchGlobalExecutor.cpp, resolve build failure when using task-to-thread Concurrency model 2024-10-25 13:01:20 -07:00
Alastair Houghton
cf77aa37df [Concurrency] Fix macOS build issue.
We need to use the `swift` namespace in `NonDispatchGlobalExecutor.cpp`.

rdar://135380149
2024-10-01 14:02:52 +01:00
Alastair Houghton
26b5fa697a [Concurrency] Rename ExecutorHooks.h, tidy up the interface.
`ExecutorHooks.h` is now nothing to do with hooks, so rename it.  Also
there are some additional functions it should declare, and a couple of
places where we've slightly messed up the boundary, for instance
`swift_task_asyncMainDrainQueue` was defined in `Task.cpp` rather than
in the executor implementations, which is wrong, so fix that too.

`CooperativeGlobalExecutor.cpp` now builds against the interface from
`ExecutorImpl.h`, rather than including the all the concurrency headers.

rdar://135380149
2024-09-30 17:15:40 +01:00
Alastair Houghton
efe5d660f2 [Concurrency] Refactor executors so they are in their own object module.
C++ executor implementations were `#include`ed into `GlobalExecutor.cpp`,
which makes it difficult to replace the global executor when using the
Embedded Concurrency library.  Refactor things so that they build into
separate objects, which means replacing them is just a matter of writing
the relevant functions yourself.

rdar://135380149
2024-09-30 17:15:38 +01:00