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