X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/db034c5228345497d775ab000b3cd19560f170c1..e4390488750913546698147eace7c878edcd233f:/interface/wx/thread.h diff --git a/interface/wx/thread.h b/interface/wx/thread.h index 3dcb9f3f2a..328879c901 100644 --- a/interface/wx/thread.h +++ b/interface/wx/thread.h @@ -518,6 +518,10 @@ enum wxCriticalSectionType @library{wxbase} @category{threading} + @note Critical sections can be used before the wxWidgets library is fully + initialized. In particular, it's safe to create global + wxCriticalSection instances. + @see wxThread, wxCondition, wxCriticalSectionLocker */ class wxCriticalSection @@ -989,7 +993,10 @@ public: /** Returns the platform specific thread ID of the current thread as a long. + This can be used to uniquely identify threads, even if they are not wxThreads. + + @see GetMainId() */ static wxThreadIdType GetCurrentId(); @@ -1007,6 +1014,15 @@ public: */ wxThreadKind GetKind() const; + /** + Returns the thread ID of the main thread. + + @see IsMain() + + @since 2.9.1 + */ + static wxThreadIdType GetMainId(); + /** Gets the priority of the thread, between zero and 100. @@ -1035,6 +1051,11 @@ public: /** Returns @true if the calling thread is the main application thread. + + Main thread in the context of wxWidgets is the one which initialized + the library. + + @see GetMainId(), GetCurrentId() */ static bool IsMain();