Changeset 17275


Ignore:
Timestamp:
10/20/13 18:31:31 (11 years ago)
Author:
tbretz
Message:
The allowed-scheme to distinguish between what to do in case of a successfully processed event and an unsucessfully processed event was buggy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mcore/Queue.h

    r17268 r17275  
    1313//    splice();                // used to efficiently implement post with mutex
    1414
     15using namespace std;
     16
    1517template<class T, class List=std::list<T>>
    1618class Queue
     
    8688            // successfull [allowed==0], the next event will be processed
    8789            // immediately.
    88             if (!fCallback || !fCallback(*it))
     90
     91            if (fCallback && fCallback(*it))
    8992                allowed = 0;
    9093
     
    9295
    9396            // Whenever an event was successfully processed, allowed
    94             // is larger than zero and thus the event will be popped
    95             if (allowed==0)
     97            // is equal to zero and thus the event will be popped
     98            if (allowed>0)
    9699                continue;
    97100
    98101            fList.erase(it);
    99 
    100102            fSize--;
    101             allowed--;
    102 
    103103        }
    104104
Note: See TracChangeset for help on using the changeset viewer.