#ifndef SYNC_QUEUE_H
#define SYNC_QUEUE_H
-#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
+#include <atomic>
#define SYNC_QUEUE_BUFSIZE 16
~sync_queue()
{
node* n = head_node;
- while (n != NULL) {
+ while (n != nullptr) {
node* prev = n;
n = n->next;
delete prev;
private:
struct node {
- node(): next(NULL) { }
+ node(): next(nullptr) { }
T values[SYNC_QUEUE_BUFSIZE];
node* next;
};