File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 59
59
#include < processthreadsapi.h>
60
60
#endif
61
61
62
+ #if SWIFT_OBJC_INTEROP
63
+ extern " C" void *objc_autoreleasePoolPush ();
64
+ extern " C" void objc_autoreleasePoolPop (void *);
65
+ #endif
66
+
62
67
using namespace swift ;
63
68
64
69
// / Should we yield the thread?
@@ -195,6 +200,10 @@ SWIFT_RUNTIME_DECLARE_THREAD_LOCAL(
195
200
void swift::runJobInEstablishedExecutorContext (Job *job) {
196
201
_swift_tsan_acquire (job);
197
202
203
+ #if SWIFT_OBJC_INTEROP
204
+ auto pool = objc_autoreleasePoolPush ();
205
+ #endif
206
+
198
207
if (auto task = dyn_cast<AsyncTask>(job)) {
199
208
// Update the active task in the current thread.
200
209
ActiveTask::set (task);
@@ -213,6 +222,10 @@ void swift::runJobInEstablishedExecutorContext(Job *job) {
213
222
job->runSimpleInFullyEstablishedContext ();
214
223
}
215
224
225
+ #if SWIFT_OBJC_INTEROP
226
+ objc_autoreleasePoolPop (pool);
227
+ #endif
228
+
216
229
_swift_tsan_release (job);
217
230
}
218
231
You can’t perform that action at this time.
0 commit comments