Suppose a thread A is running. I have another thread, B, who's not. B has been started, is on runnable state.
What happens if I call: B.join()?
Will it suspend the execution of A or will it wait for A's run() method to complete?
join() will make the currently executing thread to wait for the the thread it is called on to die.
So - If A is running, and you call B.join(), A will stop executing until B ends/dies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With