c++ /// Enqueues a task on the main executor. SWIFT_CC(swift) static void swift_task_enqueueMainExecutorImpl(Job *job) { // The cooperative executor does not distinguish between the main // queue and the global queue. swift_task_enqueueGlobalImpl(job); }
c++ SWIFT_CC(swift) static void swift_task_enqueueMainExecutorImpl(Job *job) { assert(job && "no job provided"); JobPriority priority = job->getPriority(); // This is an inline function that compiles down to a pointer to a global. auto mainQueue = dispatch_get_main_queue(); dispatchEnqueue(mainQueue, job, (dispatch_qos_class_t)priority, mainQueue); }