Mercurial > hg > openjdk > hsx16
changeset 982:49bd3de668dc
6822370: ReentrantReadWriteLock: threads hung when there are no threads holding onto the lock (Netra x4450)
Summary: This day one bug is caused by missing memory barriers in various Parker::park() paths that can result in lost wakeups and hangs.
Reviewed-by: dice, acorn
author | dholmes |
---|---|
date | Tue, 01 Dec 2009 19:10:24 -0500 |
parents | b6e6e189e1db |
children | 9adb2f184e47 |
files | src/os/linux/vm/os_linux.cpp src/os/solaris/vm/os_solaris.cpp |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os/linux/vm/os_linux.cpp Wed Nov 25 19:15:17 2009 -0800 +++ b/src/os/linux/vm/os_linux.cpp Tue Dec 01 19:10:24 2009 -0500 @@ -4656,6 +4656,7 @@ // Return immediately if a permit is available. if (_counter > 0) { _counter = 0 ; + OrderAccess::fence(); return ; } @@ -4698,6 +4699,7 @@ _counter = 0; status = pthread_mutex_unlock(_mutex); assert (status == 0, "invariant") ; + OrderAccess::fence(); return; } @@ -4737,7 +4739,7 @@ if (jt->handle_special_suspend_equivalent_condition()) { jt->java_suspend_self(); } - + OrderAccess::fence(); } void Parker::unpark() {
--- a/src/os/solaris/vm/os_solaris.cpp Wed Nov 25 19:15:17 2009 -0800 +++ b/src/os/solaris/vm/os_solaris.cpp Tue Dec 01 19:10:24 2009 -0500 @@ -5803,6 +5803,7 @@ // Return immediately if a permit is available. if (_counter > 0) { _counter = 0 ; + OrderAccess::fence(); return ; } @@ -5846,6 +5847,7 @@ _counter = 0; status = os::Solaris::mutex_unlock(_mutex); assert (status == 0, "invariant") ; + OrderAccess::fence(); return; } @@ -5891,7 +5893,7 @@ if (jt->handle_special_suspend_equivalent_condition()) { jt->java_suspend_self(); } - + OrderAccess::fence(); } void Parker::unpark() {