Home > Back-end >  Consult the Java multi-thread problem
Consult the Java multi-thread problem

Time:02-03

I think excuse me, I clearly only 20 times, where 1 and 2?

CodePudding user response:

Because you while statement did not lock, so in the judgment, while (tick> 0) when they have a problem, for example tick=1, three threads are meet the conditions, so you need to determine whether the tick in the synchronized code block is greater than zero

CodePudding user response:

The building Lord, my name is changed to for me, you are the light, even better,

CodePudding user response:

Just see the building has a 19 years of looking for a job, just have to see the latest study, want to ask the building Lord, development work before looking for how, want to know about the, I also want to go after the training, and then turned to look for a job

CodePudding user response:

The original poster can go to understand the "double check"

CodePudding user response:

Lock while also in good, in fact you so the whole way in the lock, can try to lock method
  • Related