Index: /trunk/Mars/mcore/Queue.h
===================================================================
--- /trunk/Mars/mcore/Queue.h	(revision 17267)
+++ /trunk/Mars/mcore/Queue.h	(revision 17268)
@@ -29,5 +29,7 @@
         kStop,
         kAbort,
-        kTrigger
+        kTrigger,
+        kPrompt
+
     };
 
@@ -184,7 +186,35 @@
     }
 
+    bool enablePromptExecution()
+    {
+        const std::lock_guard<std::mutex> lock(fMutex);
+        if (fState!=kIdle || fSize>0)
+            return false;
+
+        fState = kPrompt;
+        return true;
+    }
+
+    bool disablePromptExecution()
+    {
+        const std::lock_guard<std::mutex> lock(fMutex);
+        if (fState!=kPrompt)
+            return false;
+
+        fState = kIdle;
+        return true;
+    }
+
+    bool setPromptExecution(bool state)
+    {
+        return state ? enablePromptExecution() : disablePromptExecution();
+    }
+
+
     bool post(const T &val)
     {
         const std::lock_guard<std::mutex> lock(fMutex);
+        if (fState==kPrompt)
+            return fCallback(val);
 
         if (fState==kIdle)
@@ -216,4 +246,7 @@
     {
         const std::lock_guard<std::mutex> lock(fMutex);
+        if (fState==kPrompt)
+            return fCallback(T(__args...));
+
         if (fState==kIdle)
             return false;
@@ -261,4 +294,10 @@
         return fSize==0;
     }
+
+    bool operator<(const Queue& other) const
+    {
+        return fSize < other.fSize;
+    }
+
 };
 
