Merge
This commit is contained in:
commit
28bdc19b1b
@ -137,7 +137,9 @@ void G1ParScanThreadState::trim_queue() {
|
||||
do {
|
||||
// Drain the overflow stack first, so other threads can steal.
|
||||
while (_refs->pop_overflow(ref)) {
|
||||
dispatch_reference(ref);
|
||||
if (!_refs->try_push_to_taskqueue(ref)) {
|
||||
dispatch_reference(ref);
|
||||
}
|
||||
}
|
||||
|
||||
while (_refs->pop_local(ref)) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2016, 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
|
||||
@ -330,6 +330,8 @@ public:
|
||||
|
||||
// Push task t onto the queue or onto the overflow stack. Return true.
|
||||
inline bool push(E t);
|
||||
// Try to push task t onto the queue only. Returns true if successful, false otherwise.
|
||||
inline bool try_push_to_taskqueue(E t);
|
||||
|
||||
// Attempt to pop from the overflow stack; return true if anything was popped.
|
||||
inline bool pop_overflow(E& t);
|
||||
|
@ -103,6 +103,11 @@ inline bool OverflowTaskQueue<E, F, N>::push(E t)
|
||||
return true;
|
||||
}
|
||||
|
||||
template <class E, MEMFLAGS F, unsigned int N>
|
||||
inline bool OverflowTaskQueue<E, F, N>::try_push_to_taskqueue(E t) {
|
||||
return taskqueue_t::push(t);
|
||||
}
|
||||
|
||||
// pop_local_slow() is done by the owning thread and is trying to
|
||||
// get the last task in the queue. It will compete with pop_global()
|
||||
// that will be used by other threads. The tag age is incremented
|
||||
|
Loading…
x
Reference in New Issue
Block a user