/gist:716654f46c1bd83f633d Secret
Last active
August 29, 2015 14:00
AltDevBlog - Multi-Threaded Locking Queue: Node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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