mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
8047714: Fix for JDK-6546236 made Solaris os::yield() a no-op
Reviewed-by: hseigel, lfoltan
This commit is contained in:
parent
4f7e4160a0
commit
5a8cc5f33d
15 changed files with 23 additions and 47 deletions
|
@ -2808,12 +2808,10 @@ bool os::dont_yield() {
|
|||
return DontYieldALot;
|
||||
}
|
||||
|
||||
void os::yield() {
|
||||
void os::naked_yield() {
|
||||
sched_yield();
|
||||
}
|
||||
|
||||
os::YieldResult os::NakedYield() { sched_yield(); return os::YIELD_UNKNOWN; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// thread priority support
|
||||
|
||||
|
@ -3070,7 +3068,7 @@ static bool do_suspend(OSThread* osthread) {
|
|||
|
||||
for (int n = 0; !osthread->sr.is_suspended(); n++) {
|
||||
for (int i = 0; i < RANDOMLY_LARGE_INTEGER2 && !osthread->sr.is_suspended(); i++) {
|
||||
os::yield();
|
||||
os::naked_yield();
|
||||
}
|
||||
|
||||
// timeout, try to cancel the request
|
||||
|
@ -3104,7 +3102,7 @@ static void do_resume(OSThread* osthread) {
|
|||
if (sr_notify(osthread) == 0) {
|
||||
for (int n = 0; n < RANDOMLY_LARGE_INTEGER && !osthread->sr.is_running(); n++) {
|
||||
for (int i = 0; i < 100 && !osthread->sr.is_running(); i++) {
|
||||
os::yield();
|
||||
os::naked_yield();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue