Run clang-format
This commit is contained in:
@@ -1,36 +1,30 @@
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
|
||||
std::shared_ptr<T> pop()
|
||||
std::shared_ptr<T>
|
||||
pop()
|
||||
{
|
||||
std::atomic<void*>& hp=get_hazard_pointer_for_current_thread();
|
||||
node* old_head=head.load();
|
||||
do
|
||||
{
|
||||
node* temp;
|
||||
do
|
||||
{
|
||||
temp=old_head;
|
||||
hp.store(old_head);
|
||||
old_head=head.load();
|
||||
} while(old_head!=temp);
|
||||
std::atomic<void*>& hp = get_hazard_pointer_for_current_thread();
|
||||
node* old_head = head.load();
|
||||
do {
|
||||
node* temp;
|
||||
do {
|
||||
temp = old_head;
|
||||
hp.store(old_head);
|
||||
old_head = head.load();
|
||||
} while (old_head != temp);
|
||||
} while (old_head && !head.compare_exchange_strong(old_head, old_head->next));
|
||||
hp.store(nullptr);
|
||||
std::shared_ptr<T> res;
|
||||
if (old_head) {
|
||||
res.swap(old_head->data);
|
||||
if (outstanding_hazard_pointers_for(old_head)) {
|
||||
reclaim_later(old_head);
|
||||
}
|
||||
while(old_head &&
|
||||
!head.compare_exchange_strong(old_head,old_head->next));
|
||||
hp.store(nullptr);
|
||||
std::shared_ptr<T> res;
|
||||
if(old_head)
|
||||
{
|
||||
res.swap(old_head->data);
|
||||
if(outstanding_hazard_pointers_for(old_head))
|
||||
{
|
||||
reclaim_later(old_head);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete old_head;
|
||||
}
|
||||
delete_nodes_with_no_hazards();
|
||||
else {
|
||||
delete old_head;
|
||||
}
|
||||
return res;
|
||||
delete_nodes_with_no_hazards();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user