You can't exit the main thread without exiting all threads. If you need the behavior where the children continue on after the parent dies, you need "fork and exec", not threads.
If you just want to make sure all threads finish , at the end of your main program put something like
that should wait for all threads to finish. Remeber, a thread cannot be joined unless it returns or hits the end of it's code block. In an emergency, you can use the fact that calling "exit" from any thread, will kill all threads.while (threads->list()) { $_->join() foreach threads->list(threads::joinable); sleep(1); }
In reply to Re^3: panic: regfree data code 'ð' during global destruction. error when joining threads
by zentara
in thread panic: regfree data code 'ð' during global destruction. error when joining threads
by somekindafreak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |