added wxIsMainThread()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-06-29 11:51:17 +00:00
parent f0290fcacd
commit 17dbd23000

View File

@ -596,6 +596,10 @@ void WXDLLEXPORT wxMutexGuiLeave();
#define wxCRIT_SECT_DECLARE(cs) static wxCriticalSection cs
#define wxCRIT_SECT_LOCKER(name, cs) wxCriticalSectionLocker name(cs)
// function for checking if we're in the main thread which may be used whether
// wxUSE_THREADS is 0 or 1
inline bool wxIsMainThread() { return wxThread::IsMain(); }
#else // !wxUSE_THREADS
// no thread support
@ -609,6 +613,9 @@ inline void WXDLLEXPORT wxMutexGuiLeave() { }
#define wxCRIT_SECT_DECLARE(cs)
#define wxCRIT_SECT_LOCKER(name, cs)
// if there is only one thread, it is always the main one
inline bool wxIsMainThread() { return true; }
#endif // wxUSE_THREADS/!wxUSE_THREADS
// mark part of code as being a critical section: this macro declares a