From: Vadim Zeitlin Date: Mon, 30 Jun 2003 01:18:10 +0000 (+0000) Subject: added wxCRIT_SECT_DECLARE_MEMBER X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/db882c54314562f533d25f9b25b65966649e231b added wxCRIT_SECT_DECLARE_MEMBER git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index 7e6ffc0aaf..335c34f955 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -50,6 +50,7 @@ the corresponding topic. \helpref{wxCreateDynamicObject}{wxcreatedynamicobject}\\ \helpref{wxCreateFileTipProvider}{wxcreatefiletipprovider}\\ \helpref{wxCRIT\_SECT\_DECLARE}{wxcritsectdeclare}\\ +\helpref{wxCRIT\_SECT\_DECLARE\_MEMBER}{wxcritsectdeclaremember}\\ \helpref{wxCRIT\_SECT\_LOCKER}{wxcritsectlocker}\\ \helpref{wxCRITICAL\_SECTION}{wxcriticalsectionmacro}\\ % wxcs already taken! \helpref{wxDDECleanUp}{wxddecleanup}\\ @@ -705,6 +706,17 @@ This macro declares a (static) critical section object named {\it cs} if {\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$. +\membersection{wxCRIT\_SECT\_DECLARE\_MEMBER}\label{wxcritsectdeclaremember} + +\func{}{wxCRIT\_SECT\_DECLARE}{\param{}{cs}} + +This macro declares a critical section object named {\it cs} if +{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$. As it doesn't +include the {\tt static} keyword (unlike +\helpref{wxCRIT\_SECT\_DECLARE}{wxcritsectdeclare}), it can be used to declare +a class or struct member which explains its name. + + \membersection{wxCRIT\_SECT\_LOCKER}\label{wxcritsectlocker} \func{}{wxCRIT\_SECT\_LOCKER}{\param{}{name}, \param{}{cs}} diff --git a/include/wx/thread.h b/include/wx/thread.h index c91ab229af..401d5f5937 100644 --- a/include/wx/thread.h +++ b/include/wx/thread.h @@ -594,6 +594,7 @@ void WXDLLEXPORT wxMutexGuiLeave(); #define wxENTER_CRIT_SECT(cs) (cs).Enter() #define wxLEAVE_CRIT_SECT(cs) (cs).Leave() #define wxCRIT_SECT_DECLARE(cs) static wxCriticalSection cs +#define wxCRIT_SECT_DECLARE_MEMBER(cs) 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 @@ -611,6 +612,7 @@ inline void WXDLLEXPORT wxMutexGuiLeave() { } #define wxENTER_CRIT_SECT(cs) #define wxLEAVE_CRIT_SECT(cs) #define wxCRIT_SECT_DECLARE(cs) +#define wxCRIT_SECT_DECLARE_MEMBER(cs) #define wxCRIT_SECT_LOCKER(name, cs) // if there is only one thread, it is always the main one