use a common m_isInsideYield flag instead of static booleans in all ports; add a IsYielding() test which can help to fix unwanted re-entrancies

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2008-12-29 15:03:39 +00:00
parent 67badd5753
commit d181e877b0
14 changed files with 66 additions and 79 deletions

View File

@@ -176,6 +176,11 @@ public:
*/
static bool IsMainLoopRunning();
/**
Returns @true if called from inside Yield().
*/
bool IsYielding() const;
/**
Process all pending events; it is necessary to call this function to
process posted events.
@@ -466,6 +471,7 @@ public:
user to perform actions which are not compatible with the current task.
Disabling menu items or whole menus during processing can avoid unwanted
reentrance of code: see ::wxSafeYield for a better function.
You can avoid unwanted reentrancies also using IsYielding().
Note that Yield() will not flush the message logs. This is intentional as
calling Yield() is usually done to quickly update the screen and popping up