9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_HPP
25 #define SHARE_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_HPP
26 #include "gc/shared/owstTaskTerminator.hpp"
27 #include "gc/shared/taskqueue.hpp"
28 #include "memory/allocation.hpp"
29 #include "runtime/mutex.hpp"
30 #include "runtime/thread.hpp"
31
32 template<class E, MEMFLAGS F, unsigned int N = TASKQUEUE_SIZE>
33 class BufferedOverflowTaskQueue: public OverflowTaskQueue<E, F, N>
34 {
35 public:
36 typedef OverflowTaskQueue<E, F, N> taskqueue_t;
37
38 BufferedOverflowTaskQueue() : _buf_empty(true) {};
39
40 TASKQUEUE_STATS_ONLY(using taskqueue_t::stats;)
41
42 // Push task t into the queue. Returns true on success.
43 inline bool push(E t);
44
45 // Attempt to pop from the queue. Returns true on success.
46 inline bool pop(E &t);
47
48 inline void clear();
|
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_HPP
25 #define SHARE_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_HPP
26 #include "gc/shared/owstTaskTerminator.hpp"
27 #include "gc/shared/taskqueue.hpp"
28 #include "memory/allocation.hpp"
29 #include "runtime/atomic.hpp"
30 #include "runtime/mutex.hpp"
31 #include "runtime/thread.hpp"
32
33 template<class E, MEMFLAGS F, unsigned int N = TASKQUEUE_SIZE>
34 class BufferedOverflowTaskQueue: public OverflowTaskQueue<E, F, N>
35 {
36 public:
37 typedef OverflowTaskQueue<E, F, N> taskqueue_t;
38
39 BufferedOverflowTaskQueue() : _buf_empty(true) {};
40
41 TASKQUEUE_STATS_ONLY(using taskqueue_t::stats;)
42
43 // Push task t into the queue. Returns true on success.
44 inline bool push(E t);
45
46 // Attempt to pop from the queue. Returns true on success.
47 inline bool pop(E &t);
48
49 inline void clear();
|