17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_HPP
26 #define SHARE_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_HPP
27
28 #include "gc/shared/taskTerminator.hpp"
29 #include "gc/shared/taskqueue.hpp"
30 #include "gc/shenandoah/shenandoahPadding.hpp"
31 #include "memory/allocation.hpp"
32 #include "runtime/atomic.hpp"
33 #include "runtime/javaThread.hpp"
34 #include "runtime/mutex.hpp"
35 #include "utilities/debug.hpp"
36
37 template<class E, MEMFLAGS F, unsigned int N = TASKQUEUE_SIZE>
38 class BufferedOverflowTaskQueue: public OverflowTaskQueue<E, F, N>
39 {
40 public:
41 typedef OverflowTaskQueue<E, F, N> taskqueue_t;
42
43 BufferedOverflowTaskQueue() : _buf_empty(true) {};
44
45 TASKQUEUE_STATS_ONLY(using taskqueue_t::stats;)
46
47 // Push task t into the queue. Returns true on success.
48 inline bool push(E t);
49
50 // Attempt to pop from the queue. Returns true on success.
51 inline bool pop(E &t);
52
53 inline void clear();
54
55 inline bool is_empty() const {
56 return _buf_empty && taskqueue_t::is_empty();
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_HPP
26 #define SHARE_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_HPP
27
28 #include "gc/shared/taskTerminator.hpp"
29 #include "gc/shared/taskqueue.hpp"
30 #include "gc/shenandoah/shenandoahPadding.hpp"
31 #include "memory/allocation.hpp"
32 #include "runtime/atomic.hpp"
33 #include "runtime/javaThread.hpp"
34 #include "runtime/mutex.hpp"
35 #include "utilities/debug.hpp"
36
37 class ShenandoahHeap;
38
39 template<class E, MEMFLAGS F, unsigned int N = TASKQUEUE_SIZE>
40 class BufferedOverflowTaskQueue: public OverflowTaskQueue<E, F, N>
41 {
42 public:
43 typedef OverflowTaskQueue<E, F, N> taskqueue_t;
44
45 BufferedOverflowTaskQueue() : _buf_empty(true) {};
46
47 TASKQUEUE_STATS_ONLY(using taskqueue_t::stats;)
48
49 // Push task t into the queue. Returns true on success.
50 inline bool push(E t);
51
52 // Attempt to pop from the queue. Returns true on success.
53 inline bool pop(E &t);
54
55 inline void clear();
56
57 inline bool is_empty() const {
58 return _buf_empty && taskqueue_t::is_empty();
|