summaryrefslogtreecommitdiff
path: root/boost/lockfree/queue.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/lockfree/queue.hpp')
-rw-r--r--boost/lockfree/queue.hpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/boost/lockfree/queue.hpp b/boost/lockfree/queue.hpp
index 74001fba9d..4c982c4dd4 100644
--- a/boost/lockfree/queue.hpp
+++ b/boost/lockfree/queue.hpp
@@ -15,6 +15,7 @@
#include <boost/static_assert.hpp>
#include <boost/type_traits/has_trivial_assign.hpp>
#include <boost/type_traits/has_trivial_destructor.hpp>
+#include <boost/config.hpp> // for BOOST_LIKELY
#include <boost/lockfree/detail/atomic.hpp>
#include <boost/lockfree/detail/copy_payload.hpp>
@@ -286,8 +287,6 @@ private:
template <bool Bounded>
bool do_push(T const & t)
{
- using detail::likely;
-
node * n = pool.template construct<true, Bounded>(t, pool.null_handle());
handle_type node_handle = pool.get_handle(n);
@@ -301,7 +300,7 @@ private:
node * next_ptr = pool.get_pointer(next);
tagged_node_handle tail2 = tail_.load(memory_order_acquire);
- if (likely(tail == tail2)) {
+ if (BOOST_LIKELY(tail == tail2)) {
if (next_ptr == 0) {
tagged_node_handle new_tail_next(node_handle, next.get_next_tag());
if ( tail_node->next.compare_exchange_weak(next, new_tail_next) ) {
@@ -375,7 +374,6 @@ public:
template <typename U>
bool pop (U & ret)
{
- using detail::likely;
for (;;) {
tagged_node_handle head = head_.load(memory_order_acquire);
node * head_ptr = pool.get_pointer(head);
@@ -385,7 +383,7 @@ public:
node * next_ptr = pool.get_pointer(next);
tagged_node_handle head2 = head_.load(memory_order_acquire);
- if (likely(head == head2)) {
+ if (BOOST_LIKELY(head == head2)) {
if (pool.get_handle(head) == pool.get_handle(tail)) {
if (next_ptr == 0)
return false;