- unsigned int rmw_count=0;
- for (unsigned int i = 0; i < promises.size(); i++) {
- if (promises[i]==(PROMISE_RMW|PROMISE_FULFILLED))
- rmw_count++;
- }
-
- for (unsigned int i = 0; i < promises.size();i++) {
- if ((promises[i]& PROMISE_MASK) == PROMISE_UNFULFILLED) {
- //if this isn't a feasible option, keep going
- if ((rmw_count > 0)&&(promises[i] & PROMISE_RMW))
- continue;
+ bool fulfilledrmw=false;
+ for (int i = promises.size()-1 ; i>=0; i--) {
+ if (promises[i]==PROMISE_UNFULFILLED)