From c87e01d1a48d08773380367ef6c547a38a019061 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 23 May 2011 15:19:04 +0200 Subject: [PATCH 1/1] Fix missing definition in gcc 4.4/cstdatomic. --- sync_queue.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sync_queue.h b/sync_queue.h index 8888548..c2b24c3 100644 --- a/sync_queue.h +++ b/sync_queue.h @@ -3,6 +3,12 @@ #if __GNUC__ == 4 && __GNUC_MINOR__ == 4 # include // is named in gcc 4.4 + +template // fix missing definition in gcc 4.4 +void +atomic<_Tp*>::store(_Tp* __v, memory_order __m) volatile +{ atomic_address::store(__v, __m); } + #else # include #endif @@ -13,8 +19,8 @@ public: sync_queue() { node* n = new node(NULL, NULL); - std::atomic_store(&head, n); // head.store(n); - std::atomic_store(&tail, n); // tail.store(n); + head.store(n); + tail.store(n); } ~sync_queue() @@ -46,7 +52,7 @@ public: node* old_tail = tail.load(); node* n = new node(val, NULL); old_tail->next = n; - std::atomic_store(&tail, n); // tail.store(n); + tail.store(n); return (old_tail == head.load()); } @@ -57,7 +63,7 @@ public: return false; } else { node* new_head = old_head->next; - std::atomic_store(&head, new_head); // head.store(new_head); + head.store(new_head); delete old_head; res = new_head->value; return true; -- 2.39.5