mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 13:54:38 +02:00
6950075: nmethod sweeper should operate concurrently
Reviewed-by: never, kvn
This commit is contained in:
parent
85854f0e13
commit
430574f398
9 changed files with 171 additions and 89 deletions
|
@ -461,12 +461,25 @@ void CompileQueue::add(CompileTask* task) {
|
|||
//
|
||||
// Get the next CompileTask from a CompileQueue
|
||||
CompileTask* CompileQueue::get() {
|
||||
NMethodSweeper::possibly_sweep();
|
||||
|
||||
MutexLocker locker(lock());
|
||||
|
||||
// Wait for an available CompileTask.
|
||||
while (_first == NULL) {
|
||||
// There is no work to be done right now. Wait.
|
||||
lock()->wait();
|
||||
if (UseCodeCacheFlushing && (!CompileBroker::should_compile_new_jobs() || CodeCache::needs_flushing())) {
|
||||
// During the emergency sweeping periods, wake up and sweep occasionally
|
||||
bool timedout = lock()->wait(!Mutex::_no_safepoint_check_flag, NmethodSweepCheckInterval*1000);
|
||||
if (timedout) {
|
||||
MutexUnlocker ul(lock());
|
||||
// When otherwise not busy, run nmethod sweeping
|
||||
NMethodSweeper::possibly_sweep();
|
||||
}
|
||||
} else {
|
||||
// During normal operation no need to wake up on timer
|
||||
lock()->wait();
|
||||
}
|
||||
}
|
||||
|
||||
CompileTask* task = _first;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue