Lo divertido es el viaje, no el llegar.
Matthew Brown wrote:
Try changing it to synchronized(CountDown.class), and see what the effect is.
Lo divertido es el viaje, no el llegar.
Sonia Ballesteros Rey wrote:
but the output is the same. So, what next?![]()
![]()
![]()
Lo divertido es el viaje, no el llegar.
Greg Charles wrote:No, the synchronization as you've written it is done is on the object, not the whole class.
Lo divertido es el viaje, no el llegar.
Sonia Ballesteros Rey wrote:Nope, Jeff, sorry. I have not forgotten to recompile (I went to Recompile 101
)
Sonia Ballesteros Rey wrote:
and then the output is
Thread-1
9
8
7
6
5
4
3
Thread-2
2
1
0
I suppose this is just a silly problem, but really, what a pain in the ass.
Lo divertido es el viaje, no el llegar.
Sonia Ballesteros Rey wrote:
and now the output is
9
8
7
6
5
4
3
2
1
0
9
8
7
6
5
4
3
2
1
0
Lo divertido es el viaje, no el llegar.
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
|