8230422: Convert uninterruptible os::sleep calls to os::naked_short_sleep
Reviewed-by: kbarrett, dcubed, shade
This commit is contained in:
parent
f9e0cdbed9
commit
394d6ac55b
src/hotspot
cpu/x86
share
test/hotspot/gtest
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -62,7 +62,7 @@ static void do_time_measurements(volatile jlong& time_base,
|
||||
fstart = os::rdtsc();
|
||||
|
||||
// use sleep to prevent compiler from optimizing
|
||||
os::sleep(Thread::current(), FT_SLEEP_MILLISECS, true);
|
||||
os::sleep(JavaThread::current(), FT_SLEEP_MILLISECS);
|
||||
|
||||
end = os::elapsed_counter();
|
||||
OrderAccess::fence();
|
||||
|
@ -2645,7 +2645,7 @@ ConcurrentMarkSweepGeneration::expand_and_allocate(size_t word_size,
|
||||
MutexLocker x(freelistLock(), Mutex::_no_safepoint_check_flag);
|
||||
expand_for_gc_cause(word_size*HeapWordSize, MinHeapDeltaBytes, CMSExpansionCause::_satisfy_allocation);
|
||||
if (GCExpandToAllocateDelayMillis > 0) {
|
||||
os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
|
||||
os::naked_sleep(GCExpandToAllocateDelayMillis);
|
||||
}
|
||||
return have_lock_and_allocate(word_size, tlab);
|
||||
}
|
||||
@ -2684,7 +2684,7 @@ HeapWord* ConcurrentMarkSweepGeneration::expand_and_par_lab_allocate(CMSParGCThr
|
||||
// A competing par_promote might beat us to the expansion space,
|
||||
// so we may go around the loop again if promotion fails again.
|
||||
if (GCExpandToAllocateDelayMillis > 0) {
|
||||
os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
|
||||
os::naked_sleep(GCExpandToAllocateDelayMillis);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2711,7 +2711,7 @@ bool ConcurrentMarkSweepGeneration::expand_and_ensure_spooling_space(
|
||||
// A competing allocation might beat us to the expansion space,
|
||||
// so we may go around the loop again if allocation fails again.
|
||||
if (GCExpandToAllocateDelayMillis > 0) {
|
||||
os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
|
||||
os::naked_sleep(GCExpandToAllocateDelayMillis);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3544,7 +3544,7 @@ void CMSConcMarkingTask::coordinator_yield() {
|
||||
for (unsigned i = 0; i < CMSCoordinatorYieldSleepCount &&
|
||||
ConcurrentMarkSweepThread::should_yield() &&
|
||||
!CMSCollector::foregroundGCIsActive(); ++i) {
|
||||
os::sleep(Thread::current(), 1, false);
|
||||
os::naked_short_sleep(1);
|
||||
}
|
||||
|
||||
ConcurrentMarkSweepThread::synchronize(true);
|
||||
@ -5541,7 +5541,7 @@ void CMSCollector::reset_concurrent() {
|
||||
for (unsigned i = 0; i < CMSYieldSleepCount &&
|
||||
ConcurrentMarkSweepThread::should_yield() &&
|
||||
!CMSCollector::foregroundGCIsActive(); ++i) {
|
||||
os::sleep(Thread::current(), 1, false);
|
||||
os::naked_short_sleep(1);
|
||||
}
|
||||
|
||||
ConcurrentMarkSweepThread::synchronize(true);
|
||||
@ -5995,7 +5995,7 @@ void MarkRefsIntoAndScanClosure::do_yield_work() {
|
||||
ConcurrentMarkSweepThread::should_yield() &&
|
||||
!CMSCollector::foregroundGCIsActive();
|
||||
++i) {
|
||||
os::sleep(Thread::current(), 1, false);
|
||||
os::naked_short_sleep(1);
|
||||
}
|
||||
|
||||
ConcurrentMarkSweepThread::synchronize(true);
|
||||
@ -6150,7 +6150,7 @@ void ScanMarkedObjectsAgainCarefullyClosure::do_yield_work() {
|
||||
for (unsigned i = 0; i < CMSYieldSleepCount &&
|
||||
ConcurrentMarkSweepThread::should_yield() &&
|
||||
!CMSCollector::foregroundGCIsActive(); ++i) {
|
||||
os::sleep(Thread::current(), 1, false);
|
||||
os::naked_short_sleep(1);
|
||||
}
|
||||
|
||||
ConcurrentMarkSweepThread::synchronize(true);
|
||||
@ -6217,7 +6217,7 @@ void SurvivorSpacePrecleanClosure::do_yield_work() {
|
||||
for (unsigned i = 0; i < CMSYieldSleepCount &&
|
||||
ConcurrentMarkSweepThread::should_yield() &&
|
||||
!CMSCollector::foregroundGCIsActive(); ++i) {
|
||||
os::sleep(Thread::current(), 1, false);
|
||||
os::naked_short_sleep(1);
|
||||
}
|
||||
|
||||
ConcurrentMarkSweepThread::synchronize(true);
|
||||
@ -6368,7 +6368,7 @@ void MarkFromRootsClosure::do_yield_work() {
|
||||
for (unsigned i = 0; i < CMSYieldSleepCount &&
|
||||
ConcurrentMarkSweepThread::should_yield() &&
|
||||
!CMSCollector::foregroundGCIsActive(); ++i) {
|
||||
os::sleep(Thread::current(), 1, false);
|
||||
os::naked_short_sleep(1);
|
||||
}
|
||||
|
||||
ConcurrentMarkSweepThread::synchronize(true);
|
||||
@ -6982,7 +6982,7 @@ void CMSPrecleanRefsYieldClosure::do_yield_work() {
|
||||
for (unsigned i = 0; i < CMSYieldSleepCount &&
|
||||
ConcurrentMarkSweepThread::should_yield() &&
|
||||
!CMSCollector::foregroundGCIsActive(); ++i) {
|
||||
os::sleep(Thread::current(), 1, false);
|
||||
os::naked_short_sleep(1);
|
||||
}
|
||||
|
||||
ConcurrentMarkSweepThread::synchronize(true);
|
||||
@ -7547,7 +7547,7 @@ void SweepClosure::do_yield_work(HeapWord* addr) {
|
||||
for (unsigned i = 0; i < CMSYieldSleepCount &&
|
||||
ConcurrentMarkSweepThread::should_yield() &&
|
||||
!CMSCollector::foregroundGCIsActive(); ++i) {
|
||||
os::sleep(Thread::current(), 1, false);
|
||||
os::naked_short_sleep(1);
|
||||
}
|
||||
|
||||
ConcurrentMarkSweepThread::synchronize(true);
|
||||
@ -7845,7 +7845,6 @@ bool CMSCollector::par_take_from_overflow_list(size_t num,
|
||||
}
|
||||
// Grab the entire list; we'll put back a suffix
|
||||
oop prefix = cast_to_oop(Atomic::xchg((oopDesc*)BUSY, &_overflow_list));
|
||||
Thread* tid = Thread::current();
|
||||
// Before "no_of_gc_threads" was introduced CMSOverflowSpinCount was
|
||||
// set to ParallelGCThreads.
|
||||
size_t CMSOverflowSpinCount = (size_t) no_of_gc_threads; // was ParallelGCThreads;
|
||||
@ -7853,7 +7852,7 @@ bool CMSCollector::par_take_from_overflow_list(size_t num,
|
||||
// If the list is busy, we spin for a short while,
|
||||
// sleeping between attempts to get the list.
|
||||
for (size_t spin = 0; prefix == BUSY && spin < CMSOverflowSpinCount; spin++) {
|
||||
os::sleep(tid, sleep_time_millis, false);
|
||||
os::naked_sleep(sleep_time_millis);
|
||||
if (_overflow_list == NULL) {
|
||||
// Nothing left to take
|
||||
return false;
|
||||
|
@ -1304,13 +1304,12 @@ bool ParNewGeneration::take_from_overflow_list_work(ParScanThreadState* par_scan
|
||||
// Otherwise, there was something there; try claiming the list.
|
||||
oop prefix = cast_to_oop(Atomic::xchg((oopDesc*)BUSY, &_overflow_list));
|
||||
// Trim off a prefix of at most objsFromOverflow items
|
||||
Thread* tid = Thread::current();
|
||||
size_t spin_count = ParallelGCThreads;
|
||||
size_t sleep_time_millis = MAX2((size_t)1, objsFromOverflow/100);
|
||||
for (size_t spin = 0; prefix == BUSY && spin < spin_count; spin++) {
|
||||
// someone grabbed it before we did ...
|
||||
// ... we spin for a short while...
|
||||
os::sleep(tid, sleep_time_millis, false);
|
||||
// ... we spin/block for a short while...
|
||||
os::naked_sleep(sleep_time_millis);
|
||||
if (_overflow_list == NULL) {
|
||||
// nothing left to take
|
||||
return false;
|
||||
|
@ -200,7 +200,7 @@ void PSCardTable::scavenge_contents_parallel(ObjectStartArray* start_array,
|
||||
// Delay 1 worker so that it proceeds after all the work
|
||||
// has been completed.
|
||||
if (stripe_number < 2) {
|
||||
os::sleep(Thread::current(), GCWorkerDelayMillis, false);
|
||||
os::naked_sleep(GCWorkerDelayMillis);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -225,7 +225,7 @@ HeapWord* PSOldGen::allocate(size_t word_size) {
|
||||
HeapWord* PSOldGen::expand_and_allocate(size_t word_size) {
|
||||
expand(word_size*HeapWordSize);
|
||||
if (GCExpandToAllocateDelayMillis > 0) {
|
||||
os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
|
||||
os::naked_sleep(GCExpandToAllocateDelayMillis);
|
||||
}
|
||||
return allocate_noexpand(word_size);
|
||||
}
|
||||
@ -233,7 +233,7 @@ HeapWord* PSOldGen::expand_and_allocate(size_t word_size) {
|
||||
HeapWord* PSOldGen::expand_and_cas_allocate(size_t word_size) {
|
||||
expand(word_size*HeapWordSize);
|
||||
if (GCExpandToAllocateDelayMillis > 0) {
|
||||
os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
|
||||
os::naked_sleep(GCExpandToAllocateDelayMillis);
|
||||
}
|
||||
return cas_allocate_noexpand(word_size);
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ inline oop PSPromotionManager::copy_to_survivor_space(oop o) {
|
||||
// Delay the initialization of the promotion lab (plab).
|
||||
// This exposes uninitialized plabs to card table processing.
|
||||
if (GCWorkerDelayMillis > 0) {
|
||||
os::sleep(Thread::current(), GCWorkerDelayMillis, false);
|
||||
os::naked_sleep(GCWorkerDelayMillis);
|
||||
}
|
||||
#endif
|
||||
_old_lab.initialize(MemRegion(lab_base, OldPLABSize));
|
||||
|
@ -202,7 +202,7 @@ TenuredGeneration::expand_and_allocate(size_t word_size,
|
||||
while (true) {
|
||||
expand(byte_size, _min_heap_delta_bytes);
|
||||
if (GCExpandToAllocateDelayMillis > 0) {
|
||||
os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false);
|
||||
os::naked_sleep(GCExpandToAllocateDelayMillis);
|
||||
}
|
||||
result = _the_space->par_allocate(word_size);
|
||||
if ( result != NULL) {
|
||||
|
@ -134,7 +134,7 @@ void ParallelTaskTerminator::yield() {
|
||||
|
||||
void ParallelTaskTerminator::sleep(uint millis) {
|
||||
assert(_offered_termination <= _n_threads, "Invariant");
|
||||
os::sleep(Thread::current(), millis, false);
|
||||
os::naked_sleep(millis);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -280,4 +280,3 @@ TaskTerminator::~TaskTerminator() {
|
||||
delete _terminator;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ void ShenandoahPacer::pace_for_alloc(size_t words) {
|
||||
}
|
||||
cur = MAX2<size_t>(1, cur);
|
||||
|
||||
os::sleep(Thread::current(), cur, true);
|
||||
os::sleep(JavaThread::current(), cur);
|
||||
|
||||
double end = os::elapsedTime();
|
||||
total = (size_t)((end - start) * 1000);
|
||||
|
@ -50,6 +50,7 @@ void JVMCICompiler::initialize() {
|
||||
}
|
||||
|
||||
void JVMCICompiler::bootstrap(TRAPS) {
|
||||
assert(THREAD->is_Java_thread(), "must be");
|
||||
if (Arguments::mode() == Arguments::_int) {
|
||||
// Nothing to do in -Xint mode
|
||||
return;
|
||||
@ -80,7 +81,7 @@ void JVMCICompiler::bootstrap(TRAPS) {
|
||||
do {
|
||||
// Loop until there is something in the queue.
|
||||
do {
|
||||
os::sleep(THREAD, 100, true);
|
||||
os::sleep((JavaThread*)THREAD, 100);
|
||||
qsize = CompileBroker::queue_size(CompLevel_full_optimization);
|
||||
} while (!_bootstrap_compilation_request_handled && first_round && qsize == 0);
|
||||
first_round = false;
|
||||
|
@ -941,10 +941,8 @@ void JVMCIRuntime::exit_on_pending_exception(JVMCIEnv* JVMCIENV, const char* mes
|
||||
describe_pending_hotspot_exception(THREAD, true);
|
||||
}
|
||||
} else {
|
||||
// Allow error reporting thread to print the stack trace. Windows
|
||||
// doesn't allow uninterruptible wait for JavaThreads
|
||||
const bool interruptible = true;
|
||||
os::sleep(THREAD, 200, interruptible);
|
||||
// Allow error reporting thread to print the stack trace.
|
||||
os::sleep(THREAD, 200);
|
||||
}
|
||||
|
||||
before_exit(THREAD);
|
||||
|
@ -2978,7 +2978,7 @@ JVM_ENTRY(void, JVM_Sleep(JNIEnv* env, jclass threadClass, jlong millis))
|
||||
} else {
|
||||
ThreadState old_state = thread->osthread()->get_state();
|
||||
thread->osthread()->set_state(SLEEPING);
|
||||
if (os::sleep(thread, millis, true) == OS_INTRPT) {
|
||||
if (os::sleep(thread, millis) == OS_INTRPT) {
|
||||
// An asynchronous exception (e.g., ThreadDeathException) could have been thrown on
|
||||
// us while we were sleeping. We do not overwrite those.
|
||||
if (!HAS_PENDING_EXCEPTION) {
|
||||
|
@ -1837,7 +1837,19 @@ os::SuspendResume::State os::SuspendResume::switch_state(os::SuspendResume::Stat
|
||||
}
|
||||
#endif
|
||||
|
||||
int os::sleep(Thread* thread, jlong millis, bool interruptible) {
|
||||
// Convenience wrapper around naked_short_sleep to allow for longer sleep
|
||||
// times. Only for use by non-JavaThreads.
|
||||
void os::naked_sleep(jlong millis) {
|
||||
assert(!Thread::current()->is_Java_thread(), "not for use by JavaThreads");
|
||||
const jlong limit = 999;
|
||||
while (millis > limit) {
|
||||
naked_short_sleep(limit);
|
||||
millis -= limit;
|
||||
}
|
||||
naked_short_sleep(millis);
|
||||
}
|
||||
|
||||
int os::sleep(JavaThread* thread, jlong millis) {
|
||||
assert(thread == Thread::current(), "thread consistency check");
|
||||
|
||||
ParkEvent * const slp = thread->_SleepEvent;
|
||||
@ -1850,72 +1862,43 @@ int os::sleep(Thread* thread, jlong millis, bool interruptible) {
|
||||
// interrupt state.
|
||||
OrderAccess::fence();
|
||||
|
||||
if (interruptible) {
|
||||
jlong prevtime = javaTimeNanos();
|
||||
jlong prevtime = javaTimeNanos();
|
||||
|
||||
assert(thread->is_Java_thread(), "sanity check");
|
||||
JavaThread *jt = (JavaThread *) thread;
|
||||
|
||||
for (;;) {
|
||||
// interruption has precedence over timing out
|
||||
if (os::is_interrupted(thread, true)) {
|
||||
return OS_INTRPT;
|
||||
}
|
||||
|
||||
jlong newtime = javaTimeNanos();
|
||||
|
||||
if (newtime - prevtime < 0) {
|
||||
// time moving backwards, should only happen if no monotonic clock
|
||||
// not a guarantee() because JVM should not abort on kernel/glibc bugs
|
||||
assert(!os::supports_monotonic_clock(),
|
||||
"unexpected time moving backwards detected in os::sleep(interruptible)");
|
||||
} else {
|
||||
millis -= (newtime - prevtime) / NANOSECS_PER_MILLISEC;
|
||||
}
|
||||
|
||||
if (millis <= 0) {
|
||||
return OS_OK;
|
||||
}
|
||||
|
||||
prevtime = newtime;
|
||||
|
||||
{
|
||||
ThreadBlockInVM tbivm(jt);
|
||||
OSThreadWaitState osts(jt->osthread(), false /* not Object.wait() */);
|
||||
|
||||
jt->set_suspend_equivalent();
|
||||
// cleared by handle_special_suspend_equivalent_condition() or
|
||||
// java_suspend_self() via check_and_wait_while_suspended()
|
||||
|
||||
slp->park(millis);
|
||||
|
||||
// were we externally suspended while we were waiting?
|
||||
jt->check_and_wait_while_suspended();
|
||||
}
|
||||
for (;;) {
|
||||
// interruption has precedence over timing out
|
||||
if (os::is_interrupted(thread, true)) {
|
||||
return OS_INTRPT;
|
||||
}
|
||||
} else {
|
||||
OSThreadWaitState osts(thread->osthread(), false /* not Object.wait() */);
|
||||
jlong prevtime = javaTimeNanos();
|
||||
|
||||
for (;;) {
|
||||
// It'd be nice to avoid the back-to-back javaTimeNanos() calls on
|
||||
// the 1st iteration ...
|
||||
jlong newtime = javaTimeNanos();
|
||||
jlong newtime = javaTimeNanos();
|
||||
|
||||
if (newtime - prevtime < 0) {
|
||||
// time moving backwards, should only happen if no monotonic clock
|
||||
// not a guarantee() because JVM should not abort on kernel/glibc bugs
|
||||
assert(!os::supports_monotonic_clock(),
|
||||
"unexpected time moving backwards detected on os::sleep(!interruptible)");
|
||||
} else {
|
||||
millis -= (newtime - prevtime) / NANOSECS_PER_MILLISEC;
|
||||
}
|
||||
if (newtime - prevtime < 0) {
|
||||
// time moving backwards, should only happen if no monotonic clock
|
||||
// not a guarantee() because JVM should not abort on kernel/glibc bugs
|
||||
assert(!os::supports_monotonic_clock(),
|
||||
"unexpected time moving backwards detected in os::sleep()");
|
||||
} else {
|
||||
millis -= (newtime - prevtime) / NANOSECS_PER_MILLISEC;
|
||||
}
|
||||
|
||||
if (millis <= 0) break ;
|
||||
if (millis <= 0) {
|
||||
return OS_OK;
|
||||
}
|
||||
|
||||
prevtime = newtime;
|
||||
|
||||
{
|
||||
ThreadBlockInVM tbivm(thread);
|
||||
OSThreadWaitState osts(thread->osthread(), false /* not Object.wait() */);
|
||||
|
||||
thread->set_suspend_equivalent();
|
||||
// cleared by handle_special_suspend_equivalent_condition() or
|
||||
// java_suspend_self() via check_and_wait_while_suspended()
|
||||
|
||||
prevtime = newtime;
|
||||
slp->park(millis);
|
||||
|
||||
// were we externally suspended while we were waiting?
|
||||
thread->check_and_wait_while_suspended();
|
||||
}
|
||||
return OS_OK ;
|
||||
}
|
||||
}
|
||||
|
@ -467,13 +467,19 @@ class os: AllStatic {
|
||||
// thread id on Linux/64bit is 64bit, on Windows and Solaris, it's 32bit
|
||||
static intx current_thread_id();
|
||||
static int current_process_id();
|
||||
static int sleep(Thread* thread, jlong ms, bool interruptable);
|
||||
// Short standalone OS sleep suitable for slow path spin loop.
|
||||
// Ignores Thread.interrupt() (so keep it short).
|
||||
// ms = 0, will sleep for the least amount of time allowed by the OS.
|
||||
// Implementation of java.lang.Thread.sleep for JavaThreads
|
||||
static int sleep(JavaThread* thread, jlong ms);
|
||||
// Short standalone OS sleep routines suitable for slow path spin loop.
|
||||
// Ignores safepoints/suspension/Thread.interrupt() (so keep it short).
|
||||
// ms/ns = 0, will sleep for the least amount of time allowed by the OS.
|
||||
// Maximum sleep time is just under 1 second.
|
||||
static void naked_short_sleep(jlong ms);
|
||||
static void naked_short_nanosleep(jlong ns);
|
||||
static void infinite_sleep(); // never returns, use with CAUTION
|
||||
// Longer standalone OS sleep routine - a convenience wrapper around
|
||||
// multiple calls to naked_short_sleep. Only for use by non-JavaThreads.
|
||||
static void naked_sleep(jlong millis);
|
||||
// Never returns, use with CAUTION
|
||||
static void infinite_sleep();
|
||||
static void naked_yield () ;
|
||||
static OSReturn set_priority(Thread* thread, ThreadPriority priority);
|
||||
static OSReturn get_priority(const Thread* const thread, ThreadPriority& priority);
|
||||
|
@ -939,7 +939,7 @@ void SafepointSynchronize::print_safepoint_timeout() {
|
||||
break; // Could not send signal. Report fatal error.
|
||||
}
|
||||
// Give cur_thread a chance to report the error and terminate the VM.
|
||||
os::sleep(Thread::current(), 3000, false);
|
||||
os::naked_sleep(3000);
|
||||
}
|
||||
}
|
||||
fatal("Safepoint sync time longer than " INTX_FORMAT "ms detected when executing %s.",
|
||||
|
@ -145,7 +145,7 @@ TEST_VM(G1FreeIdSetTest, stress) {
|
||||
tty->print_cr("Stressing G1FreeIdSet for %u ms", milliseconds_to_run);
|
||||
{
|
||||
ThreadInVMfromNative invm(this_thread);
|
||||
os::sleep(this_thread, milliseconds_to_run, true);
|
||||
os::sleep(this_thread, milliseconds_to_run);
|
||||
}
|
||||
OrderAccess::release_store(&continue_running, false);
|
||||
for (uint i = 0; i < nthreads; ++i) {
|
||||
|
@ -224,7 +224,7 @@ static void run_test(BufferNode::Allocator* allocator, CompletedList* cbl) {
|
||||
tty->print_cr("Stressing allocator for %u ms", milliseconds_to_run);
|
||||
{
|
||||
ThreadInVMfromNative invm(this_thread);
|
||||
os::sleep(this_thread, milliseconds_to_run, true);
|
||||
os::sleep(this_thread, milliseconds_to_run);
|
||||
}
|
||||
OrderAccess::release_store(&allocator_running, false);
|
||||
for (uint i = 0; i < nthreads; ++i) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -133,9 +133,10 @@ TEST_VM(TestSingleWriterSynchronizer, stress) {
|
||||
writer->doit();
|
||||
|
||||
tty->print_cr("Stressing synchronizer for %u ms", milliseconds_to_run);
|
||||
JavaThread* cur = JavaThread::current();
|
||||
{
|
||||
ThreadInVMfromNative invm(JavaThread::current());
|
||||
os::sleep(Thread::current(), milliseconds_to_run, true);
|
||||
ThreadInVMfromNative invm(cur);
|
||||
os::sleep(cur, milliseconds_to_run);
|
||||
}
|
||||
continue_running = 0;
|
||||
for (uint i = 0; i < nreaders + 1; ++i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user