From: Arnaud Giersch Date: Mon, 23 May 2011 13:19:04 +0000 (+0200) Subject: Fix missing definition in gcc 4.4/cstdatomic. X-Git-Tag: v0.1~62^2~9 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/c87e01d1a48d08773380367ef6c547a38a019061 Fix missing definition in gcc 4.4/cstdatomic. --- 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;