1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/private/threadinfo.h
3 // Purpose: declaration of wxThreadSpecificInfo: thread-specific information
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_PRIVATE_THREADINFO_H_
11 #define _WX_PRIVATE_THREADINFO_H_
17 class WXDLLIMPEXP_FWD_BASE wxLog
;
19 // ----------------------------------------------------------------------------
20 // wxThreadSpecificInfo: contains all thread-specific information used by wx
21 // ----------------------------------------------------------------------------
23 // currently the only thread-specific information we use is the active wxLog
24 // target but more could be added in the future (e.g. current wxLocale would be
25 // a likely candidate) and we will group all of them in this struct to avoid
26 // consuming more TLS slots than necessary as there is only a limited number of
29 // NB: this must be a POD to be stored in TLS
30 struct wxThreadSpecificInfo
32 // the thread-specific logger or NULL if the thread is using the global one
33 // (this is not used for the main thread which always uses the global
37 // true if logging is currently disabled for this thread (this is also not
38 // used for the main thread which uses wxLog::ms_doLog)
40 // NB: we use a counter-intuitive "disabled" flag instead of "enabled" one
41 // because the default, for 0-initialized struct, should be to enable
46 // currently this is defined in src/common/log.cpp
47 extern wxTLS_TYPE(wxThreadSpecificInfo
) wxThreadInfoVar
;
48 #define wxThreadInfo wxTLS_VALUE(wxThreadInfoVar)
50 #endif // wxUSE_THREADS
52 #endif // _WX_PRIVATE_THREADINFO_H_