<div dir="ltr"><div>The assumption is that the thread can provably never continue. That implies `stop` never being called. So, there is no observable difference.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">robert engels <<a href="mailto:rengels@ix.netcom.com">rengels@ix.netcom.com</a>> ezt írta (időpont: 2024. júl. 3., Sze, 16:38):<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 style="overflow-wrap: break-word;">But won’t that be a breaking api change:<div><br></div><div><div style="color:rgb(64,64,64);background-color:rgb(255,255,255);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;line-height:18px;white-space:pre-wrap"><div><span style="color:rgb(146,205,120)">/**</span></div><div><span style="color:rgb(146,205,120)">     * Retrieves and removes the head of this queue, waiting if necessary</span></div><div><span style="color:rgb(146,205,120)">     * until an element becomes available.</span></div><div><span style="color:rgb(146,205,120)">     *</span></div><div><span style="color:rgb(146,205,120)">     * </span><span style="color:rgb(63,151,223)">@return</span><span style="color:rgb(146,205,120)"> the head of this queue</span></div><div><span style="color:rgb(146,205,120)">     * </span><span style="color:rgb(63,151,223)">@throws</span><span style="color:rgb(146,205,120)"> </span><span style="color:rgb(70,224,192)">InterruptedException</span><span style="color:rgb(146,205,120)"> if interrupted while waiting</span></div><div><span style="color:rgb(146,205,120)">     */</span></div><div>    <span style="color:rgb(70,224,192)">E</span> <span style="color:rgb(99,99,36)">take</span>() <span style="color:rgb(63,151,223)">throws</span> <span style="color:rgb(70,224,192)">InterruptedException</span>;</div></div><div><br></div><div>For example, given this code:</div><div><br></div><div>T timedGetElement() throws InterruptedException {</div><div style="color:rgb(0,0,0)">  Timer t = Timer.start();</div><div>   try {</div><div>      return queue.take();</div><div>   } finally {</div><div>      t.stop();</div><div>   }</div><div>}</div><div><br></div><div>With the proposed changes, stop() may never be called - leading to potential resource leaks.</div><div><br></div><div>Whereas currently the rules ensure stop() will be called unless the application hard terminates. This would essentially equating thread “death” with a hard application termination from an observability standpoint.</div><div><br></div><div>You would have similar issues with any tracing/logging type frameworks.</div><div><br></div></div></div></blockquote></div></div>