Help me with multi-threaded programs that stops in the middle of process

Help me with multi-threaded programs that stops in the middle of process

When you return from main, the program will stop even if there are other threads.