Drop BlockingConcurrentQueue.

This commit is contained in:
Bartosz Taudul 2019-07-29 22:58:13 +02:00
parent 480a427e07
commit 7ae9a28e32

View File

@ -242,7 +242,6 @@ struct ProducerToken;
struct ConsumerToken; struct ConsumerToken;
template<typename T, typename Traits> class ConcurrentQueue; template<typename T, typename Traits> class ConcurrentQueue;
template<typename T, typename Traits> class BlockingConcurrentQueue;
class ConcurrentQueueTests; class ConcurrentQueueTests;
@ -362,9 +361,6 @@ struct ProducerToken
template<typename T, typename Traits> template<typename T, typename Traits>
explicit ProducerToken(ConcurrentQueue<T, Traits>& queue); explicit ProducerToken(ConcurrentQueue<T, Traits>& queue);
template<typename T, typename Traits>
explicit ProducerToken(BlockingConcurrentQueue<T, Traits>& queue);
ProducerToken(ProducerToken&& other) MOODYCAMEL_NOEXCEPT ProducerToken(ProducerToken&& other) MOODYCAMEL_NOEXCEPT
: producer(other.producer) : producer(other.producer)
{ {
@ -427,9 +423,6 @@ struct ConsumerToken
template<typename T, typename Traits> template<typename T, typename Traits>
explicit ConsumerToken(ConcurrentQueue<T, Traits>& q); explicit ConsumerToken(ConcurrentQueue<T, Traits>& q);
template<typename T, typename Traits>
explicit ConsumerToken(BlockingConcurrentQueue<T, Traits>& q);
ConsumerToken(ConsumerToken&& other) MOODYCAMEL_NOEXCEPT ConsumerToken(ConsumerToken&& other) MOODYCAMEL_NOEXCEPT
: initialOffset(other.initialOffset), lastKnownGlobalOffset(other.lastKnownGlobalOffset), itemsConsumedFromCurrent(other.itemsConsumedFromCurrent), currentProducer(other.currentProducer), desiredProducer(other.desiredProducer) : initialOffset(other.initialOffset), lastKnownGlobalOffset(other.lastKnownGlobalOffset), itemsConsumedFromCurrent(other.itemsConsumedFromCurrent), currentProducer(other.currentProducer), desiredProducer(other.desiredProducer)
{ {
@ -2122,15 +2115,6 @@ ProducerToken::ProducerToken(ConcurrentQueue<T, Traits>& queue)
} }
} }
template<typename T, typename Traits>
ProducerToken::ProducerToken(BlockingConcurrentQueue<T, Traits>& queue)
: producer(reinterpret_cast<ConcurrentQueue<T, Traits>*>(&queue)->recycle_or_create_producer(true))
{
if (producer != nullptr) {
producer->token = this;
}
}
template<typename T, typename Traits> template<typename T, typename Traits>
ConsumerToken::ConsumerToken(ConcurrentQueue<T, Traits>& queue) ConsumerToken::ConsumerToken(ConcurrentQueue<T, Traits>& queue)
: itemsConsumedFromCurrent(0), currentProducer(nullptr), desiredProducer(nullptr) : itemsConsumedFromCurrent(0), currentProducer(nullptr), desiredProducer(nullptr)
@ -2139,14 +2123,6 @@ ConsumerToken::ConsumerToken(ConcurrentQueue<T, Traits>& queue)
lastKnownGlobalOffset = static_cast<std::uint32_t>(-1); lastKnownGlobalOffset = static_cast<std::uint32_t>(-1);
} }
template<typename T, typename Traits>
ConsumerToken::ConsumerToken(BlockingConcurrentQueue<T, Traits>& queue)
: itemsConsumedFromCurrent(0), currentProducer(nullptr), desiredProducer(nullptr)
{
initialOffset = reinterpret_cast<ConcurrentQueue<T, Traits>*>(&queue)->nextExplicitConsumerId.fetch_add(1, std::memory_order_release);
lastKnownGlobalOffset = static_cast<std::uint32_t>(-1);
}
template<typename T, typename Traits> template<typename T, typename Traits>
inline void swap(ConcurrentQueue<T, Traits>& a, ConcurrentQueue<T, Traits>& b) MOODYCAMEL_NOEXCEPT inline void swap(ConcurrentQueue<T, Traits>& a, ConcurrentQueue<T, Traits>& b) MOODYCAMEL_NOEXCEPT
{ {