[concurrency-interest] LinkedTransferQueue port to JDK5

Guy Korland gkorland at gmail.com
Thu Apr 22 13:56:56 EDT 2010


I'm trying to port LinkedTransferQueue to JDK5 but there are two lines
that are using methods that are only available since JDK6 (lines 661 & 665).

Are those lines necessary? Can't I replace them with the JDK5 version?
Meaning without the "this"


      658             else if (timed) {

      659                 long now = System.nanoTime();

      660                 if ((nanos -= now - lastTime) > 0)

*      661                     LockSupport.parkNanos(this, nanos);*

      662                 lastTime = now;

      663             }

      664             else {

*      665                 LockSupport.park(this);*

      666                 s.waiter = null;

      667                 spins = -1;                   // spin if
front upon wakeup

      668             }

Thanks,
Guy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20100422/ed84e3be/attachment.html>


More information about the Concurrency-interest mailing list