[Solved] How do I make threads run sequentially instead of concurrently?


If we need the second thread start to run after the first one is completed, is a thread really needed?

For solution I think try to set a global flag, the set the value in the first thread, and when start the second thread, check the flag first should work.

2

solved How do I make threads run sequentially instead of concurrently?