8029453: java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java failed by timeout
Reviewed-by: bdelsart, ddmitriev, dcubed
--- 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 {