X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f66f6a5b3583b02c34854556eb83e3a808524ce..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/thread.h?ds=sidebyside diff --git a/interface/wx/thread.h b/interface/wx/thread.h index 1b3954f321..61becf5847 100644 --- a/interface/wx/thread.h +++ b/interface/wx/thread.h @@ -169,6 +169,33 @@ public: */ wxCondError Wait(); + /** + Waits until the condition is signalled and the associated condition true. + + This is a convenience overload that may be used to ignore spurious + awakenings while waiting for a specific condition to become true. + + Equivalent to + @code + while ( !predicate() ) + { + wxCondError e = Wait(); + if ( e != wxCOND_NO_ERROR ) + return e; + } + return wxCOND_NO_ERROR; + @endcode + + The predicate would typically be a C++11 lambda: + @code + condvar.Wait([]{return value == 1;}); + @endcode + + @since 3.0 + */ + template + wxCondError Wait(const Functor& predicate); + /** Waits until the condition is signalled or the timeout has elapsed. @@ -1217,9 +1244,9 @@ public: The following symbolic constants can be used in addition to raw values in 0..100 range: - - ::wxPRIORITY_MIN: 0 - - ::wxPRIORITY_DEFAULT: 50 - - ::wxPRIORITY_MAX: 100 + - @c wxPRIORITY_MIN: 0 + - @c wxPRIORITY_DEFAULT: 50 + - @c wxPRIORITY_MAX: 100 */ void SetPriority(unsigned int priority); @@ -1261,7 +1288,7 @@ public: This function can only be called from another thread context. - @param waitMode + @param flags As described in wxThreadWait documentation, wxTHREAD_WAIT_BLOCK should be used as the wait mode even although currently wxTHREAD_WAIT_YIELD is for compatibility reasons. This parameter is