changeset 32353:90d7e2214fe5

8029453: java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java failed by timeout Reviewed-by: bdelsart, ddmitriev, dcubed
author dholmes
date Thu, 13 Aug 2015 22:08:40 -0400
parents fec57eb3f599
children d75120971606
files hotspot/src/os/linux/vm/os_linux.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/os/linux/vm/os_linux.cpp	Thu Aug 13 09:32:01 2015 +0200
+++ b/hotspot/src/os/linux/vm/os_linux.cpp	Thu Aug 13 22:08:40 2015 -0400
@@ -5785,9 +5785,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 {