ConcurrentLinkedQueue Code Explanation

后端 未结 2 428
悲哀的现实
悲哀的现实 2020-12-31 21:18

http://www.java2s.com/Open-Source/Java-Open-Source-Library/7-JDK/java/java/util/concurrent/ConcurrentLinkedQueue.java.htm

The above is the source code of ConcurrentL

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 22:14

    The ConcurrentLinkedQueue allows concurrent modification of the internal list while traversing it. This implies that the node you are looking at could have been removed concurrently. To detect such situations the next pointer of a removed node is changed to point to itself. Look at updateHead (L302) for details.

提交回复
热议问题