Skip to content

Instantly share code, notes, and snippets.

@sigmel
Last active August 29, 2015 14:00
AltDevBlog - Multi-Threaded Locking Queue: Node
class LockingQueueNode
{
public:
LockingQueueNode(std::unique_ptr<int> initialData) :
_data(std::move(initialData)), _next(nullptr) {}
std::shared_ptr<LockingQueueNode> GetNext() { return _next; }
void SetNext(std::unique_ptr<LockingQueueNode> next) { _next = std::move(next); }
std::unique_ptr<int> GetData() { return std::move(_data); }
private:
std::unique_ptr<int> _data;
std::shared_ptr<LockingQueueNode> _next;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment