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_
15 class WXDLLIMPEXP_FWD_BASE wxLog
;
17 // ----------------------------------------------------------------------------
18 // wxThreadSpecificInfo: contains all thread-specific information used by wx
19 // ----------------------------------------------------------------------------
21 // Group all thread-specific information we use (e.g. the active wxLog target)
22 // a in this class to avoid consuming more TLS slots than necessary as there is
23 // only a limited number of them.
24 class wxThreadSpecificInfo
27 // Return this thread's instance.
28 static wxThreadSpecificInfo
& Get();
30 // the thread-specific logger or NULL if the thread is using the global one
31 // (this is not used for the main thread which always uses the global
35 // true if logging is currently disabled for this thread (this is also not
36 // used for the main thread which uses wxLog::ms_doLog)
38 // NB: we use a counter-intuitive "disabled" flag instead of "enabled" one
39 // because the default, for 0-initialized struct, should be to enable
44 wxThreadSpecificInfo() : logger(NULL
), loggingDisabled(false) {}
47 #define wxThreadInfo wxThreadSpecificInfo::Get()
49 #endif // _WX_PRIVATE_THREADINFO_H_