From d66ae9e943fd28b0846c9de236e8cbdd9a948ed6 Mon Sep 17 00:00:00 2001 From: dholmes Date: Mon, 17 Aug 2015 21:14:26 -0400 Subject: [PATCH] 8029453: java/util/concurrent/locks/ReentrantLock/TimeoutLockLoops.java failed by timeout Reviewed-by: bdelsart, ddmitriev, dcubed --- src/os/linux/vm/os_linux.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp index bbe347e84..4f7c38ab3 100644 --- a/src/os/linux/vm/os_linux.cpp +++ b/src/os/linux/vm/os_linux.cpp @@ -5922,9 +5922,11 @@ void Parker::unpark() { 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 { -- GitLab