6763959: java.util.concurrent.locks.LockSupport.parkUntil(0) blocks forever

Mon, 04 Oct 2010 13:11:10 -0400

author
acorn
date
Mon, 04 Oct 2010 13:11:10 -0400
changeset 2220
1c352af0135d
parent 2159
2966dab85b3e
child 2221
644f98c78e33

6763959: java.util.concurrent.locks.LockSupport.parkUntil(0) blocks forever
Summary: Absolute time 0 needs to return immediately.
Reviewed-by: phh, dcubed, dholmes

src/os/linux/vm/os_linux.cpp file | annotate | diff | comparison | revisions
src/os/solaris/vm/os_solaris.cpp file | annotate | diff | comparison | revisions
src/os/windows/vm/os_windows.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/os/linux/vm/os_linux.cpp	Tue Sep 21 06:58:44 2010 -0700
     1.2 +++ b/src/os/linux/vm/os_linux.cpp	Mon Oct 04 13:11:10 2010 -0400
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -4839,7 +4839,7 @@
    1.11  
    1.12    // Next, demultiplex/decode time arguments
    1.13    timespec absTime;
    1.14 -  if (time < 0) { // don't wait at all
    1.15 +  if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all
    1.16      return;
    1.17    }
    1.18    if (time > 0) {
     2.1 --- a/src/os/solaris/vm/os_solaris.cpp	Tue Sep 21 06:58:44 2010 -0700
     2.2 +++ b/src/os/solaris/vm/os_solaris.cpp	Mon Oct 04 13:11:10 2010 -0400
     2.3 @@ -1,5 +1,5 @@
     2.4  /*
     2.5 - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
     2.6 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
     2.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8   *
     2.9   * This code is free software; you can redistribute it and/or modify it
    2.10 @@ -5837,7 +5837,7 @@
    2.11  
    2.12    // First, demultiplex/decode time arguments
    2.13    timespec absTime;
    2.14 -  if (time < 0) { // don't wait at all
    2.15 +  if (time < 0 || (isAbsolute && time == 0) ) { // don't wait at all
    2.16      return;
    2.17    }
    2.18    if (time > 0) {
     3.1 --- a/src/os/windows/vm/os_windows.cpp	Tue Sep 21 06:58:44 2010 -0700
     3.2 +++ b/src/os/windows/vm/os_windows.cpp	Mon Oct 04 13:11:10 2010 -0400
     3.3 @@ -3992,7 +3992,7 @@
     3.4    if (time < 0) { // don't wait
     3.5      return;
     3.6    }
     3.7 -  else if (time == 0) {
     3.8 +  else if (time == 0 && !isAbsolute) {
     3.9      time = INFINITE;
    3.10    }
    3.11    else if  (isAbsolute) {

mercurial