/* ZynAddSubFX - a software synthesizer MultiPseudoStack.cpp - Multiple-Writer Lock Free Datastructure Copyright (C) 2016 Mark McCurry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "MultiPseudoStack.h" #include #include #define INVALID ((int32_t)0xffffffff) #define MAX ((int32_t)0x7fffffff) QueueListItem::QueueListItem(void) :memory(0), size(0) { } LockFreeQueue::LockFreeQueue(qli_t *data_, int n) :data(data_), elms(n), next_r(0), next_w(0), avail(0) { tag = new std::atomic[n]; for(int i=0; i