diff --git a/src/TSLQueue.hpp b/src/TSLQueue.hpp index 58b468f..76e29d0 100644 --- a/src/TSLQueue.hpp +++ b/src/TSLQueue.hpp @@ -2,7 +2,6 @@ #define UDPC_THREADSAFE_LINKEDLIST_QUEUE_HPP #include -#include #include #include #include @@ -118,9 +117,14 @@ TSLQueue::~TSLQueue() { } template -TSLQueue::TSLQueue(TSLQueue &&other) +TSLQueue::TSLQueue(TSLQueue &&other) : + sharedSpinLock(UDPC::SharedSpinLock::newInstance()), + head(std::shared_ptr(new TSLQNode())), + tail(std::shared_ptr(new TSLQNode())), + msize(0) { - std::lock_guard lock(other.mutex); + auto selfWriteLock = sharedSpinLock->spin_write_lock(); + auto otherWriteLock = other.sharedSpinLock->spin_write_lock(); head = std::move(other.head); tail = std::move(other.tail); msize = std::move(other.msize);