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 62
62
#include < processthreadsapi.h>
63
63
#endif
64
64
65
+ #if SWIFT_OBJC_INTEROP
66
+ extern " C" void *objc_autoreleasePoolPush ();
67
+ extern " C" void objc_autoreleasePoolPop (void *);
68
+ #endif
69
+
65
70
using namespace swift ;
66
71
67
72
// / Should we yield the thread?
@@ -198,6 +203,10 @@ SWIFT_RUNTIME_DECLARE_THREAD_LOCAL(
198
203
void swift::runJobInEstablishedExecutorContext (Job *job) {
199
204
_swift_tsan_acquire (job);
200
205
206
+ #if SWIFT_OBJC_INTEROP
207
+ auto pool = objc_autoreleasePoolPush ();
208
+ #endif
209
+
201
210
if (auto task = dyn_cast<AsyncTask>(job)) {
202
211
// Update the active task in the current thread.
203
212
ActiveTask::set (task);
@@ -216,6 +225,10 @@ void swift::runJobInEstablishedExecutorContext(Job *job) {
216
225
job->runSimpleInFullyEstablishedContext ();
217
226
}
218
227
228
+ #if SWIFT_OBJC_INTEROP
229
+ objc_autoreleasePoolPop (pool);
230
+ #endif
231
+
219
232
_swift_tsan_release (job);
220
233
}
221
234
You can’t perform that action at this time.
0 commit comments