How this java code produces deadlock?

前端 未结 5 1726
被撕碎了的回忆
被撕碎了的回忆 2020-12-21 10:23

i am going through oracle docs for deadlock.. i found this code

public class Deadlock {
    static class Friend {
        private final String name;
                 


        
5条回答
  •  抹茶落季
    2020-12-21 11:04

    in the end of bow A and G call bowBack, leading to a call of G.bow from A and a A.bow from G while bow of A and G is synchronized. So so they both wait for each other to finish.

提交回复
热议问题