Index: /trunk/FACT++/src/queue.h
===================================================================
--- /trunk/FACT++/src/queue.h	(revision 17219)
+++ /trunk/FACT++/src/queue.h	(revision 17220)
@@ -10,9 +10,8 @@
 {
     size_t fSize;                 // Only necessary for before C++11
-    bool   fSort;                 // Sort the list before processing
 
     std::list<T> fList;
 
-    std::mutex fMutex;             // Mutex needed for the conditional
+    std::mutex fMutex;        // Mutex needed for the conditional
     std::condition_variable fCond; // Conditional
 
@@ -23,10 +22,9 @@
         kStop,
         kAbort,
-        kTrigger
     };
 
     state_t fState;               // Stop signal for the thread
 
-    typedef std::function<bool(const T &)> callback;
+    typedef std::function<void(const T &)> callback;
     callback fCallback;       // Callback function called by the thread
 
@@ -37,14 +35,9 @@
         std::unique_lock<std::mutex> lock(fMutex);
 
-        // No filling allowed by default (the queue is
-        // always processed until it is empty)
-        size_t allowed = 0;
-
         while (1)
         {
-            while (fSize==allowed && fState==kRun)
+            while (fList.empty() && fState==kRun)
                 fCond.wait(lock);
 
-            // Check if the State flag has been changed
             if (fState==kAbort)
                 break;
@@ -53,18 +46,5 @@
                 break;
 
-            // If thread got just woken up, move back the state to kRun
-            if (fState == kTrigger)
-                fState = kRun;
-
-            // Could have been a fState==kTrigger case
-            if (fList.empty())
-                continue;
-
-            // During the unlocked state, fSize might change.
-            // The current size of the queue needs to be saved.
-            allowed = fSize;
-
-            // get the first entry from the (sorted) list
-            const auto it = fSort ? min_element(fList.begin(), fList.end()) : fList.begin();
+            const T &val = fList.front();
 
             // Theoretically, we can loose a signal here, but this is
@@ -72,28 +52,11 @@
             lock.unlock();
 
-            // If the first event in the queue could not be processed,
-            // no further processing makes sense until a new event has
-            // been posted (or the number of events in the queue has
-            // changed)  [allowed>0], in the case processing was
-            // successfull [alloed==0], the next event will be processed
-            // immediately.
-            if (!fCallback || !fCallback(*it))
-                allowed = 0;
+            if (fCallback)
+                fCallback(val);
 
             lock.lock();
 
-            // Whenever an event was successfully processed, allowed
-            // is larger than zero and thus the event will be popped
-            if (allowed==0)
-                continue;
-
-            if (fSort)
-                fList.erase(it);
-            else
-                fList.pop_front() ;
-
+            fList.pop_front();
             fSize--;
-            allowed--;
-
         }
 
@@ -105,23 +68,8 @@
 
 public:
-    Queue(const callback &f, bool sort=false, bool startup=true) : fSize(0), fSort(sort), fState(kIdle), fCallback(f)
+    Queue(const callback &f) : fSize(0), fState(kIdle), fCallback(f)
     {
-        if (startup)
-            start();
+        start();
     }
-
-    Queue(const Queue<T>& q) : fSize(0), fSort(q.fSort), fState(kIdle), fCallback(q.fCallback)
-    {
-    }
-
-    Queue<T>& operator = (const Queue<T>& q)
-    {
-        fSize     = 0;
-        fSort     = q.fSort;
-        fState    = kIdle;
-        fCallback = q.fCallback;
-        return *this;
-    }
-
     ~Queue()
     {
@@ -185,5 +133,4 @@
     {
         const std::lock_guard<std::mutex> lock(fMutex);
-
         if (fState==kIdle)
             return false;
@@ -192,16 +139,4 @@
         fSize++;
 
-        fCond.notify_one();
-
-        return true;
-    }
-
-    bool notify()
-    {
-        const std::lock_guard<std::mutex> lock(fMutex);
-        if (fState!=kRun)
-            return false;
-
-        fState = kTrigger;
         fCond.notify_one();
 
