有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (2) 个答案

  1. # 1 楼答案

    我想答案就在Doug Leas对这个问题的评论中:http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6207928

    Doug Lea写道:

    The current design and behavior are intentional. Read-locks are normally not defined to have a notion of ownership, so ownership cannot be tested. … The JSR166 EG has received a few requests to optionally support per-thread read-hold tracking. Doing this would significantly increase lock overhead, so would need to be governed by an optional construction parameter. We are looking into it.

  2. # 2 楼答案

    可重入写回。getReadHoldCount()似乎可以完成这项工作