When I use the old Python thread
API everything works fine:
thread.start_new_thread(main_func, args, kwargs)
But if I try to use the new threading API the process, which runs the thread hangs when it should exit itself with sys.exit(3)
:
threading.Thread(target=main_func, args=args, kwargs=kwargs).start()
How can I translate the code to the new threading API?
You can see this example in context.