<div dir="ltr">>  Was there ever any thoughts to add an API point for defining new montor objects, such as Object.newLock() or perhaps even something like Object.newLock(Class context, String tag)? <br><br>Does it have any advantages over ReentrantLock?<br><br>Glavo</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Jan 27, 2026 at 2:28 PM Eirik Bjørsnøs <<a href="mailto:eirbjo@gmail.com">eirbjo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Tue, Jan 27, 2026 at 12:05 AM Roger Riggs <<a href="mailto:roger.riggs@oracle.com" target="_blank">roger.riggs@oracle.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
  <div>
    Hi,<br>
    <br>
    String is also an Identity class  and its value could distinguish
    between the cases. (Both strings can be very short).<br>
    <br>
    About java.lang.Object as a lock, the pervasiveness of `new
    Object()` for locks resulted in giving it special dispensation in as
    a supertype of value objects. Trying to change its existing uses was
    determined to be infeasible.<br></div></blockquote><div><br></div><div>Great minds are pulling this thread in interesting directions, which is fine! I may go ahead file a PR to focus on the specific small changes initially suggested. Then any broader discussions can continue here.</div><div><br></div><div>Was there ever any thoughts to add an API point for defining new montor objects, such as Object.newLock() or perhaps even something like Object.newLock(Class context, String tag)? </div><div><br></div><div>Perhaps this could:</div><div><br></div><div>a) Make the semantics/purpose of creating a new object more clear </div><div>b) Allow the JVM to return any object it wants</div><div>c) Allow monitor objects to be more informative</div><div><br></div><div>Cheers,</div><div>Eirik.</div></div></div>
</blockquote></div>