<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1646" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=946535819-22042010><FONT face="Courier New" color=#0000ff 
size=2>Hi Guy,</FONT></SPAN></DIV>
<DIV><SPAN class=946535819-22042010><FONT face="Courier New" color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=946535819-22042010><FONT face="Courier New" color=#0000ff 
size=2>I believe that is correct. The "this" is only used to keep track of 
AbstractOwnableSynchronizers so that they can be reported in thread 
dumps.</FONT></SPAN></DIV>
<DIV><SPAN class=946535819-22042010><FONT face="Courier New" color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=946535819-22042010><FONT face="Courier New" color=#0000ff 
size=2>David Holmes</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> 
  concurrency-interest-bounces@cs.oswego.edu 
  [mailto:concurrency-interest-bounces@cs.oswego.edu]<B>On Behalf Of </B>Guy 
  Korland<BR><B>Sent:</B> Friday, 23 April 2010 3:57 AM<BR><B>To:</B> 
  concurrency-interest<BR><B>Subject:</B> [concurrency-interest] 
  LinkedTransferQueue port to JDK5<BR><BR></FONT></DIV>
  <DIV dir=ltr>
  <DIV style="FONT-FAMILY: monospace"><PRE><SPAN>I'm trying to port LinkedTransferQueue to JDK5 but there are two lines<BR>that are using methods that are only available since JDK6 (lines 661 &amp; 665).<BR>

Are those lines necessary? Can't I replace them with the JDK5 version?<BR>Meaning without the "this"<BR><BR><BR>      658</SPAN>             else if (timed) {<BR></PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><SPAN>      659</SPAN>                 long now = System.nanoTime();<BR>
</PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><SPAN>      660</SPAN>                 if ((nanos -= now - lastTime) &gt; 0)<BR></PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><B><SPAN>      661</SPAN>                     LockSupport.parkNanos(this, nanos);</B><BR></PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><SPAN>      662</SPAN>                 lastTime = now;<BR><BR></PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><SPAN>      663</SPAN>             }<BR></PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><SPAN>      664</SPAN>             else {<BR>
</PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><B><SPAN>      665</SPAN>                 LockSupport.park(this);</B><BR></PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><SPAN>      666</SPAN>                 s.waiter = null;<BR>

</PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><SPAN>      667</SPAN>                 spins = -1;                   // spin if front upon wakeup<BR>
</PRE></DIV>
  <DIV style="FONT-FAMILY: monospace"><PRE><SPAN>      668</SPAN>             }<BR><BR>Thanks,<BR>Guy<BR></PRE></DIV></DIV></BLOCKQUOTE></BODY></HTML>