2 class PopOp:
public OpRecord{
4 std::atomic<PopHelper *>
assoc;
7 assert(
sizeof(
PopOp) <= ALIGNLEN);
12 void *
begin(WFVector *vec);
32 controlWord=&(ph->
child);
34 int popPos=vec->csize.load();
37 if(fcount++ == MAX_FAILURES){
39 vec->announceOp(
this);
50 ArrayElement *spot=vec->getSpot(popPos);
51 void *expected= spot->load();
53 if( expected==NOT_VALUE){
54 if(spot->compare_exchange_strong(expected, Helper::mark(ph)) ){
70 controlWord=&(ph->
child);
77 else if(Helper::isHelper(expected)){
78 Helper *tHelper=Helper::unmark(expected);
80 if(!tHelper->watch(expected, spot)){
83 bool helpRes=Helper::remove(vec, popPos,expected );
90 vec->announceOp((
void *)
this);
107 controlWord=(std::atomic<void *> *)&(
assoc);
109 int popPos=vec->csize.load();
117 if(
assoc.compare_exchange_strong(temp1, temp2) || temp1 == temp2){
129 ArrayElement *spot=vec->getSpot(popPos);
130 void *expected= spot->load();
132 if( expected==NOT_VALUE){
133 if (spot->compare_exchange_strong(expected, Helper::mark(ph)) ) {
150 else if (Helper::isHelper(expected)) {
151 Helper *tHelper=Helper::unmark(expected);
152 if(!tHelper->watch(expected, spot)){
156 Helper::remove(vec, popPos,expected);
bool isValid(void *value)
Returns whether or not the passed value is has one of the reserved bits set to 1. ...
Definition: util.h:155
bool getResult(void *&v)
Definition: pop_helper.h:191
std::atomic< void * > child
Definition: pop_helper.h:5
bool complete(WFVector *vec, int pos)
Definition: pop_helper.h:214
PopOp()
Definition: pop_op.h:6
void * begin(WFVector *vec)
Definition: pop_op.h:29
std::atomic< PopHelper * > assoc
Definition: pop_op.h:4
Definition: pop_helper.h:3
bool tryFree()
Definition: pop_helper.h:278
void execute(WFVector *vec)
Definition: pop_op.h:16
void * s_execute(WFVector *vec)
Definition: pop_op.h:104