< prev index next >

src/share/vm/gc_implementation/shenandoah/shenandoahTaskqueue.inline.hpp

Print this page
rev 10668 : [backport] Cleanup buffered queue handling
rev 10772 : [backport] Update copyrights

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2016, Red Hat, Inc. and/or its affiliates.
+ * Copyright (c) 2016, 2018, Red Hat, Inc. All rights reserved.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.
  *

@@ -23,16 +23,23 @@
 
 #ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_INLINE_HPP
 #define SHARE_VM_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_INLINE_HPP
 
 template <class E, MEMFLAGS F, unsigned int N>
-bool BufferedOverflowTaskQueue<E, F, N>::pop_buffer(E &t)
+bool BufferedOverflowTaskQueue<E, F, N>::pop(E &t)
 {
-  if (_buf_empty) return false;
+  if (!_buf_empty) {
   t = _elem;
   _buf_empty = true;
   return true;
+  }
+
+  if (taskqueue_t::pop_local(t)) {
+    return true;
+  }
+
+  return taskqueue_t::pop_overflow(t);
 }
 
 template <class E, MEMFLAGS F, unsigned int N>
 inline bool BufferedOverflowTaskQueue<E, F, N>::push(E t)
 {
< prev index next >