Added wxThread::GetMainId().

This is useful for checking if a message was logged from the main thread or not and also allows us to implement IsMain() by comparing GetCurrentId() with GetMainId() in all ports and avoid repetition.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-11 20:46:55 +00:00
parent 7dfede7b92
commit f922638305
6 changed files with 51 additions and 60 deletions

View File

@@ -989,7 +989,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 +1010,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 +1047,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();