Mutithreading with System.out.format and System.out.println

前端 未结 4 1439
梦毁少年i
梦毁少年i 2021-01-14 16:14

I came across this example on Oracle\'s Java Tutorial describing Deadlock in multi threading scenarios.

So in this example I made following change at line 17 and lin

4条回答
  •  Happy的楠姐
    2021-01-14 16:45

    To support the rest of the answers here with some actual proof I ran your code in a loop and it deadlocked 82 times out of 100 tries, so your code most definitely still deadlocks.

提交回复
热议问题