I am using Swift to create a DLL to run inside a program. I’ve noticed that if I use anything like Task or await while all the work completes, when the program tries to end, it stalls running at 100% CPU on a single core. If I call swift_task_asyncMainDrainQueue() it seems to stop the core from running at 100% utilization, but the program still will not exit and stalls when calling swift_task_asyncMainDrainQueue().
If I do want to use Swift’s async model, is there a clean up / exit that model without stalling the main program when that main program tries to exit?
On MacOS this is a non-issue and the program exits cleanly.