Commit ab2a2752 authored by Dominik Charousset's avatar Dominik Charousset

Add more requirements

parent 5ec54456
...@@ -268,11 +268,15 @@ class single_reader_queue { ...@@ -268,11 +268,15 @@ class single_reader_queue {
pointer e = m_stack.load(); pointer e = m_stack.load();
// must not be called on a closed queue // must not be called on a closed queue
CAF_REQUIRE(e != nullptr); CAF_REQUIRE(e != nullptr);
// fetching data while blocked is an error
CAF_REQUIRE(e != reader_blocked_dummy());
// it's enough to check this once, since only the owner is allowed // it's enough to check this once, since only the owner is allowed
// to close the queue and only the owner is allowed to call this // to close the queue and only the owner is allowed to call this
// member function // member function
while (e != end_ptr) { while (e != end_ptr) {
if (m_stack.compare_exchange_weak(e, end_ptr)) { if (m_stack.compare_exchange_weak(e, end_ptr)) {
// fetching data while blocked is an error
CAF_REQUIRE(e != reader_blocked_dummy());
if (is_dummy(e)) { if (is_dummy(e)) {
// only use-case for this is closing a queue // only use-case for this is closing a queue
CAF_REQUIRE(end_ptr == nullptr); CAF_REQUIRE(end_ptr == nullptr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment