changeset 7536:54203a323126

8029453: java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java failed by timeout Reviewed-by: bdelsart, ddmitriev, dcubed
author dholmes
date Mon, 17 Aug 2015 21:14:26 -0400
parents dae2d83e0ec2
children 7985a33bac9c
files src/os/linux/vm/os_linux.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/linux/vm/os_linux.cpp	Mon Aug 17 15:44:58 2015 +0100
+++ b/src/os/linux/vm/os_linux.cpp	Mon Aug 17 21:14:26 2015 -0400
@@ -5922,9 +5922,11 @@
         status = pthread_mutex_unlock(_mutex);
         assert (status == 0, "invariant");
       } else {
+        // must capture correct index before unlocking
+        int index = _cur_index;
         status = pthread_mutex_unlock(_mutex);
         assert (status == 0, "invariant");
-        status = pthread_cond_signal (&_cond[_cur_index]);
+        status = pthread_cond_signal (&_cond[index]);
         assert (status == 0, "invariant");
       }
     } else {