<div dir="ltr">I was responding to Peter Levart's suggestion of checking for the presence of a security manager before calling doPrivileged.  Which is not an important question now, given that the primary question is whether we should allow future.cancel() to interrupt within a doPrivileged.<div>
<br></div><div>Alternatively, is there a reasonable way for a security manager to enable such usages without enabling arbitrary modifyThread?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 2, 2013 at 9:03 PM, David Holmes <span dir="ltr"><<a href="mailto:david.holmes@oracle.com" target="_blank">david.holmes@oracle.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 3/10/2013 1:55 PM, Martin Buchholz wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Oct 2, 2013 at 7:13 PM, David Holmes <<a href="mailto:david.holmes@oracle.com" target="_blank">david.holmes@oracle.com</a>><u></u>wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 3/10/2013 2:54 AM, Martin Buchholz wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, Oct 2, 2013 at 9:49 AM, Peter Levart <<a href="mailto:peter.levart@gmail.com" target="_blank">peter.levart@gmail.com</a>><br>
wrote:<br>
<br>
  Hi Martin,<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If you want to optimize for without-security-manager case<br>
<br>
</blockquote>
<br>
<br>
I want to optimize for the case that Thread.interrupt does not throw<br>
SecurityException<br>
<br>
</blockquote>
<br>
How is your proposal optimizing that case ???<br>
</blockquote>
<br>
<br>
Instead of doing extra work to avoid a SecurityException, I am assuming a<br>
SecurityException is rare, and risk having to throw it twice.<br>
</blockquote>
<br></div></div>
Sorry I'm missing something - what extra work are you avoiding and where? The original code just did t.interrupt() now you've added try/catch with a second privileged interrupt attempt. I don't see anything being avoided. Are you referring to caller code that catches the SecurityException itself and somehow retries?<span class="HOEnZb"><font color="#888888"><br>

<br>
David<br>
<br>
</font></span></blockquote></div><br></div>