[swift-users] Bls: GCD and Process

Quinn "The Eskimo!" eskimo1 at apple.com
Fri Jan 6 02:35:19 CST 2017


On 6 Jan 2017, at 07:53, Mr Bee via swift-users <swift-users at swift.org> wrote:

> How to make my app alive to make the second queue finish its job?

The standard approach here is to park the main thread [1] in `dispatchMain()`.  Then, when all your work is done, exit the process explicitly by calling `exit(_:)`.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

[1] This doesn’t actually park the thread (at least on Darwin platforms) but instead does the rather neat trick of terminating the main thread while leaving the process alive (-:



More information about the swift-users mailing list