Commit 478f539d authored by neverlord's avatar neverlord Committed by Dominik Charousset

Fix initialization of atomic flags

parent 768e16db
...@@ -109,18 +109,19 @@ class double_ended_queue { ...@@ -109,18 +109,19 @@ class double_ended_queue {
static_assert(sizeof(node*) < CAF_CACHE_LINE_SIZE, static_assert(sizeof(node*) < CAF_CACHE_LINE_SIZE,
"sizeof(node*) >= CAF_CACHE_LINE_SIZE"); "sizeof(node*) >= CAF_CACHE_LINE_SIZE");
double_ended_queue() double_ended_queue() {
: m_head_lock(ATOMIC_FLAG_INIT), m_head_lock.clear();
m_tail_lock(ATOMIC_FLAG_INIT) { m_tail_lock.clear();
auto ptr = new node(nullptr); auto ptr = new node(nullptr);
m_head = ptr; m_head = ptr;
m_tail = ptr; m_tail = ptr;
} }
~double_ended_queue() { ~double_ended_queue() {
while (m_head) { auto ptr = m_head.load();
unique_node_ptr tmp{m_head.load()}; while (ptr) {
m_head = tmp->next.load(); unique_node_ptr tmp{ptr};
ptr = tmp->next.load();
} }
} }
......
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