Made wxLogXXX() functions thread-safe.

They can now be called from any thread and will buffer the messages until the
current log target is flushed from the main thread. This makes earlier code to
do the same thing specifically for wxLogWindow unnecessary and also allows to
use wxLogMessage() in the thread sample instead of using manual logging there.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-12 17:02:30 +00:00
parent dbe0872fc8
commit 232addd1cd
6 changed files with 228 additions and 136 deletions

View File

@@ -756,14 +756,22 @@ public:
/**
Shows all the messages currently in buffer and clears it.
If the buffer is already empty, nothing happens.
It should only be called from the main application thread.
If you override this method in a derived class, call the base class
version first, before doing anything else, to ensure that any buffered
messages from the other threads are logged.
*/
virtual void Flush();
/**
Flushes the current log target if any, does nothing if there is none.
@see Flush()
As Flush() itself, this method should only be called from the main
application thread.
*/
static void FlushActive();