[concurrency-interest] LinkedTransferQueue port to JDK5

David Holmes davidcholmes at aapt.net.au
Thu Apr 22 15:59:49 EDT 2010


Hi Guy,

I believe that is correct. The "this" is only used to keep track of
AbstractOwnableSynchronizers so that they can be reported in thread dumps.

David Holmes
  -----Original Message-----
  From: concurrency-interest-bounces at cs.oswego.edu
[mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of Guy Korland
  Sent: Friday, 23 April 2010 3:57 AM
  To: concurrency-interest
  Subject: [concurrency-interest] LinkedTransferQueue port to JDK5


I'm trying to port LinkedTransferQueue to JDK5 but there are two linesthat
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/20100423/89c914f0/attachment.html>


More information about the Concurrency-interest mailing list