#if __GNUC__ == 4 && __GNUC_MINOR__ == 4
# include <cstdatomic> // <atomic> is named <cstdatomic> in gcc 4.4
+
+template<typename _Tp> // fix missing definition in gcc 4.4
+void
+atomic<_Tp*>::store(_Tp* __v, memory_order __m) volatile
+{ atomic_address::store(__v, __m); }
+
#else
# include <atomic>
#endif
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()
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());
}
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;