From 86a948fc0ff124d2ef03956ac507c923cbb262eb Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 3 May 2017 11:42:16 +0200 Subject: Document that QLoggingCategory is thread-safe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-60475 Change-Id: Idced5e1a8ad1d2d28839fd23126a7bf084141eca Reviewed-by: Topi Reiniƶ --- src/corelib/io/qloggingcategory.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qloggingcategory.cpp') diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index 967a614a2d..69af936bca 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -63,6 +63,7 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \class QLoggingCategory \inmodule QtCore \since 5.2 + \threadsafe \brief The QLoggingCategory class represents a category, or 'area' in the logging infrastructure. @@ -95,6 +96,9 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \li Category names starting with \c{qt} are reserved for Qt modules. \endlist + QLoggingCategory objects implicitly defined by Q_LOGGING_CATEGORY() + are created on first use in a thread-safe manner. + \section1 Checking Category Configuration QLoggingCategory provides \l isDebugEnabled(), \l isInfoEnabled(), @@ -458,6 +462,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if debug output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qDebug() */ @@ -477,6 +483,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if debug output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qDebug() */ @@ -499,6 +507,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if debug output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qInfo() */ @@ -518,6 +528,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if debug output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qInfo() */ @@ -540,6 +552,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if warning output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qWarning() */ @@ -559,6 +573,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if warning output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qWarning() */ @@ -581,6 +597,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if critical output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qCritical() */ @@ -600,6 +618,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if critical output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qCritical() */ /*! @@ -624,7 +644,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \a string identifier. By default, all message types are enabled. Only one translation unit in a library or executable can define a category - with a specific name. + with a specific name. The implicitly defined QLoggingCategory object is + created on first use, in a thread-safe manner. This macro must be used outside of a class or method. */ @@ -640,7 +661,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) and more severe are enabled, types with a lower severity are disabled. Only one translation unit in a library or executable can define a category - with a specific name. + with a specific name. The implicitly defined QLoggingCategory object is + created on first use, in a thread-safe manner. This macro must be used outside of a class or method. It is only defined if variadic macros are supported. -- cgit v1.2.3