diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index f2ec0de54b..bfd0cbe3f4 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -36460,7 +36460,8 @@ bool MessageManager::currentThreadHasLockedMessageManager() const throw() } MessageManagerLock::MessageManagerLock() throw() - : locked (false) + : lastLockingThreadId (0), + locked (false) { if (MessageManager::instance != 0) { diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 1429c71323..b0ac88ed80 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -37324,22 +37324,35 @@ public: /** Returns the global instance of the MessageManager. */ static MessageManager* getInstance() throw(); + /** Runs the event dispatch loop until a stop message is posted. + + This method is only intended to be run by the application's startup routine, + as it blocks, and will only return after the stopDispatchLoop() method has been used. + + @see stopDispatchLoop + */ void runDispatchLoop(); + + /** Sends a signal that the dispatch loop should terminate. + + After this is called, the runDispatchLoop() or runDispatchLoopUntil() methods + will be interrupted and will return. + + @see runDispatchLoop + */ void stopDispatchLoop(); + + /** Returns true if the stopDispatchLoop() method has been called. + */ bool hasStopMessageBeenSent() const throw() { return quitMessagePosted; } /** Synchronously dispatches messages until a given time has elapsed. - Returns false if a quit message has been posted, otherwise returns true. + Returns false if a quit message has been posted by a call to stopDispatchLoop(), + otherwise returns true. */ bool runDispatchLoopUntil (int millisecondsToRunFor); - /*int runModalLoop (Component* componentToBeModal); - bool makeComponentModal (Component* componentToBeModal); - bool isComponentModal (const Component* component) const; - Component* getCurrentModalComponent() const; - void exitModalLoop (int returnValue);*/ - /** Calls a function using the message-thread. This can be used by any thread to cause this function to be called-back diff --git a/src/juce_appframework/events/juce_MessageManager.cpp b/src/juce_appframework/events/juce_MessageManager.cpp index b2ddba7c13..55f26c43d0 100644 --- a/src/juce_appframework/events/juce_MessageManager.cpp +++ b/src/juce_appframework/events/juce_MessageManager.cpp @@ -189,7 +189,8 @@ bool MessageManager::currentThreadHasLockedMessageManager() const throw() //============================================================================== MessageManagerLock::MessageManagerLock() throw() - : locked (false) + : lastLockingThreadId (0), + locked (false) { if (MessageManager::instance != 0) { diff --git a/src/juce_appframework/events/juce_MessageManager.h b/src/juce_appframework/events/juce_MessageManager.h index 140cc57a50..04defe80d0 100644 --- a/src/juce_appframework/events/juce_MessageManager.h +++ b/src/juce_appframework/events/juce_MessageManager.h @@ -60,23 +60,35 @@ public: static MessageManager* getInstance() throw(); //============================================================================== + /** Runs the event dispatch loop until a stop message is posted. + + This method is only intended to be run by the application's startup routine, + as it blocks, and will only return after the stopDispatchLoop() method has been used. + + @see stopDispatchLoop + */ void runDispatchLoop(); + + /** Sends a signal that the dispatch loop should terminate. + + After this is called, the runDispatchLoop() or runDispatchLoopUntil() methods + will be interrupted and will return. + + @see runDispatchLoop + */ void stopDispatchLoop(); + + /** Returns true if the stopDispatchLoop() method has been called. + */ bool hasStopMessageBeenSent() const throw() { return quitMessagePosted; } /** Synchronously dispatches messages until a given time has elapsed. - Returns false if a quit message has been posted, otherwise returns true. + Returns false if a quit message has been posted by a call to stopDispatchLoop(), + otherwise returns true. */ bool runDispatchLoopUntil (int millisecondsToRunFor); - //============================================================================== - /*int runModalLoop (Component* componentToBeModal); - bool makeComponentModal (Component* componentToBeModal); - bool isComponentModal (const Component* component) const; - Component* getCurrentModalComponent() const; - void exitModalLoop (int returnValue);*/ - //============================================================================== /** Calls a function using the message-thread.