Reputation: 13983
I need to allow task execution after main thread exits. Is it possible? Or I should use Thread class explicitly for this purpose?
Upvotes: 1
Views: 206
Reputation: 1500525
You could write your own task scheduler to schedule tasks on non-threadpool-threads... but a simpler option would probably be to start a foreground thread which just waits for the relevant tasks to complete.
(It's hard to give a code sample as you haven't shown how the tasks are started etc, but it should be fairly easy.)
Upvotes: 3