+ 2
Question about threads
Why this code do not print in console string "Second thread stopped"? https://code.sololearn.com/crLaPIbBjL3R/?ref=app
5 odpowiedzi
+ 3
It print....
+ 2
it looks like you some some infinite loops setup.
+ 2
Welcome! 🙃
May be in the end was "Time exceeded"...
+ 2
@Rustam Allev When I ran the code as is... it never completed and nothing was displayed. when I changed to (a == b). It ran and statements were printed out. The 2nd statement did not print. I changed the while (!threadstops) to While(threadstops). the 2nd statement did print and it did not run continuously. I haven't messed with threading hardly at all.. ... it's just what I observed..and I don't know if this helps. 😃 I'm sure someone else may come along and give a better answer.