Why this code do not print in console string "Second thread stopped"? https://code.sololearn.com/crLaPIbBjL3R/?ref=app
12/6/2019 9:48:12 AM
Rustam Aliev5 Answers
New Answerlaura , loop in main() just for testing thread - not infinite loop ;-) id001x , i don't understand whats happened, but it print only after publishing. When script is beeing private, console does not printing last string from second thread. 2All: thanks a lot!
@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.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message