Strange code in java.util.concurrent.LinkedBlockingQueue

后端 未结 4 730
傲寒
傲寒 2020-12-31 10:32

All!

I found strange code in LinkedBlockingQueue:

private E dequeue() {
        // assert takeLock.isHeldByCurrentThread();
        Node h =         


        
4条回答
  •  情歌与酒
    2020-12-31 10:46

    If you look at the jsr166 src then you will find the offending commit, scroll down to v1.51

    This shows the answer is in this bug report

    The full discussion can be found in a jsr.166 mailing list thread

    The "helping GC" bit is about avoiding things bleeding into tenured.

提交回复
热议问题