qthreadstorage.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/thread/qthreadstorage.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qthreadstorage.h"-
41-
42#ifndef QT_NO_THREAD-
43#include "qthread.h"-
44#include "qthread_p.h"-
45#include "qmutex.h"-
46-
47#include <string.h>-
48-
49QT_BEGIN_NAMESPACE-
50-
51// #define THREADSTORAGE_DEBUG-
52#ifdef THREADSTORAGE_DEBUG-
53# define DEBUG_MSG qtsDebug-
54-
55# include <stdio.h>-
56# include <stdarg.h>-
57void qtsDebug(const char *fmt, ...)-
58{-
59 va_list va;-
60 va_start(va, fmt);-
61-
62 fprintf(stderr, "QThreadStorage: ");-
63 vfprintf(stderr, fmt, va);-
64 fprintf(stderr, "\n");-
65-
66 va_end(va);-
67}-
68#else-
69# define DEBUG_MSG if(false)qDebug-
70#endif-
71-
72static QBasicMutex destructorsMutex;-
73typedef QVector<void (*)(void *)> DestructorMap;-
74Q_GLOBAL_STATIC(DestructorMap, destructors)
executed 262 times by 234 tests: end of block
Executed by:
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qalgorithms - unknown status
  • tst_qanimationgroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • ...
executed 262 times by 234 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qalgorithms - unknown status
  • tst_qanimationgroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • ...
executed 4645 times by 477 tests: return &holder.value;
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
guard.load() =...c::InitializedDescription
TRUEevaluated 262 times by 234 tests
Evaluated by:
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qalgorithms - unknown status
  • tst_qanimationgroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • ...
FALSEnever evaluated
0-4645
75-
76QThreadStorageData::QThreadStorageData(void (*func)(void *))-
77{-
78 QMutexLocker locker(&destructorsMutex);-
79 DestructorMap *destr = destructors();-
80 if (!destr) {
!destrDescription
TRUEnever evaluated
FALSEevaluated 629 times by 294 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
0-629
81 /*-
82 the destructors vector has already been destroyed, yet a new-
83 QThreadStorage is being allocated. this can only happen during global-
84 destruction, at which point we assume that there is only one thread.-
85 in order to keep QThreadStorage working, we need somewhere to store-
86 the data, best place we have in this situation is at the tail of the-
87 current thread's tls vector. the destructor is ignored, since we have-
88 no where to store it, and no way to actually call it.-
89 */-
90 QThreadData *data = QThreadData::current();-
91 id = data->tls.count();-
92 DEBUG_MSG("QThreadStorageData: Allocated id %d, destructor %p cannot be stored", id, func);
dead code: QMessageLogger(__FILE__, 92, __PRETTY_FUNCTION__).debug("QThreadStorageData: Allocated id %d, destructor %p cannot be stored", id, func);
-
93 return;
never executed: return;
0
94 }-
95 for (id = 0; id < destr->count(); id++) {
id < destr->count()Description
TRUEevaluated 670 times by 195 tests
Evaluated by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • ...
FALSEevaluated 629 times by 294 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
629-670
96 if (destr->at(id) == 0)
destr->at(id) == 0Description
TRUEnever evaluated
FALSEevaluated 670 times by 195 tests
Evaluated by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • ...
0-670
97 break;
never executed: break;
0
98 }
executed 670 times by 195 tests: end of block
Executed by:
  • tst_Gestures
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QComplexText
  • tst_QCssParser
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • ...
670
99 if (id == destr->count()) {
id == destr->count()Description
TRUEevaluated 629 times by 294 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
FALSEnever evaluated
0-629
100 destr->append(func);-
101 } else {
executed 629 times by 294 tests: end of block
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
629
102 (*destr)[id] = func;-
103 }
never executed: end of block
0
104 DEBUG_MSG("QThreadStorageData: Allocated id %d, destructor %p", id, func);
dead code: QMessageLogger(__FILE__, 104, __PRETTY_FUNCTION__).debug("QThreadStorageData: Allocated id %d, destructor %p", id, func);
-
105}
executed 629 times by 294 tests: end of block
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
629
106-
107QThreadStorageData::~QThreadStorageData()-
108{-
109 DEBUG_MSG("QThreadStorageData: Released id %d", id);
dead code: QMessageLogger(__FILE__, 109, __PRETTY_FUNCTION__).debug("QThreadStorageData: Released id %d", id);
-
110 QMutexLocker locker(&destructorsMutex);-
111 if (destructors())
destructors()Description
TRUEevaluated 703 times by 281 tests
Evaluated by:
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qalgorithms - unknown status
  • tst_qanimationgroup - unknown status
  • tst_qapplication - unknown status
  • ...
FALSEnever evaluated
0-703
112 (*destructors())[id] = 0;
executed 703 times by 281 tests: (*destructors())[id] = 0;
Executed by:
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qalgorithms - unknown status
  • tst_qanimationgroup - unknown status
  • tst_qapplication - unknown status
  • ...
703
113}
executed 703 times by 281 tests: end of block
Executed by:
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qalgorithms - unknown status
  • tst_qanimationgroup - unknown status
  • tst_qapplication - unknown status
  • ...
703
114-
115void **QThreadStorageData::get() const-
116{-
117 QThreadData *data = QThreadData::current();-
118 if (!data) {
!dataDescription
TRUEnever evaluated
FALSEevaluated 21169158 times by 420 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
0-21169158
119 qWarning("QThreadStorage::get: QThreadStorage can only be used with threads started with QThread");-
120 return 0;
never executed: return 0;
0
121 }-
122 QVector<void *> &tls = data->tls;-
123 if (tls.size() <= id)
tls.size() <= idDescription
TRUEevaluated 1958 times by 320 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
FALSEevaluated 21167200 times by 332 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • ...
1958-21167200
124 tls.resize(id + 1);
executed 1958 times by 320 tests: tls.resize(id + 1);
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
1958
125 void **v = &tls[id];-
126-
127 DEBUG_MSG("QThreadStorageData: Returning storage %d, data %p, for thread %p",
dead code: QMessageLogger(__FILE__, 127, __PRETTY_FUNCTION__).debug("QThreadStorageData: Returning storage %d, data %p, for thread %p", id, *v, data->thread.load());
-
128 id,
dead code: QMessageLogger(__FILE__, 127, __PRETTY_FUNCTION__).debug("QThreadStorageData: Returning storage %d, data %p, for thread %p", id, *v, data->thread.load());
-
129 *v,
dead code: QMessageLogger(__FILE__, 127, __PRETTY_FUNCTION__).debug("QThreadStorageData: Returning storage %d, data %p, for thread %p", id, *v, data->thread.load());
-
130 data->thread.load());
dead code: QMessageLogger(__FILE__, 127, __PRETTY_FUNCTION__).debug("QThreadStorageData: Returning storage %d, data %p, for thread %p", id, *v, data->thread.load());
-
131-
132 return *v ? v : 0;
executed 21169158 times by 420 tests: return *v ? v : 0;
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
21169158
133}-
134-
135void **QThreadStorageData::set(void *p)-
136{-
137 QThreadData *data = QThreadData::current();-
138 if (!data) {
!dataDescription
TRUEnever evaluated
FALSEevaluated 12825 times by 341 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
0-12825
139 qWarning("QThreadStorage::set: QThreadStorage can only be used with threads started with QThread");-
140 return 0;
never executed: return 0;
0
141 }-
142 QVector<void *> &tls = data->tls;-
143 if (tls.size() <= id)
tls.size() <= idDescription
TRUEnever evaluated
FALSEevaluated 12825 times by 341 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
0-12825
144 tls.resize(id + 1);
never executed: tls.resize(id + 1);
0
145-
146 void *&value = tls[id];-
147 // delete any previous data-
148 if (value != 0) {
value != 0Description
TRUEevaluated 210 times by 124 tests
Evaluated by:
  • tst_QApplication
  • tst_QFontCache
  • tst_QNetworkReply
  • tst_languagechange - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qcolordialog - unknown status
  • tst_qcolumnview - unknown status
  • tst_qcombobox - unknown status
  • tst_qcommandlinkbutton - unknown status
  • tst_qcompleter - unknown status
  • tst_qcomplextext - unknown status
  • tst_qcssparser - unknown status
  • tst_qdatawidgetmapper - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdialog - unknown status
  • tst_qdialogbuttonbox - unknown status
  • ...
FALSEevaluated 12615 times by 318 tests
Evaluated by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
210-12615
149 DEBUG_MSG("QThreadStorageData: Deleting previous storage %d, data %p, for thread %p",
dead code: QMessageLogger(__FILE__, 149, __PRETTY_FUNCTION__).debug("QThreadStorageData: Deleting previous storage %d, data %p, for thread %p", id, value, data->thread.load());
-
150 id,
dead code: QMessageLogger(__FILE__, 149, __PRETTY_FUNCTION__).debug("QThreadStorageData: Deleting previous storage %d, data %p, for thread %p", id, value, data->thread.load());
-
151 value,
dead code: QMessageLogger(__FILE__, 149, __PRETTY_FUNCTION__).debug("QThreadStorageData: Deleting previous storage %d, data %p, for thread %p", id, value, data->thread.load());
-
152 data->thread.load());
dead code: QMessageLogger(__FILE__, 149, __PRETTY_FUNCTION__).debug("QThreadStorageData: Deleting previous storage %d, data %p, for thread %p", id, value, data->thread.load());
-
153-
154 QMutexLocker locker(&destructorsMutex);-
155 DestructorMap *destr = destructors();-
156 void (*destructor)(void *) = destr ? destr->value(id) : 0;
destrDescription
TRUEevaluated 210 times by 124 tests
Evaluated by:
  • tst_QApplication
  • tst_QFontCache
  • tst_QNetworkReply
  • tst_languagechange - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qcolordialog - unknown status
  • tst_qcolumnview - unknown status
  • tst_qcombobox - unknown status
  • tst_qcommandlinkbutton - unknown status
  • tst_qcompleter - unknown status
  • tst_qcomplextext - unknown status
  • tst_qcssparser - unknown status
  • tst_qdatawidgetmapper - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdialog - unknown status
  • tst_qdialogbuttonbox - unknown status
  • ...
FALSEnever evaluated
0-210
157 locker.unlock();-
158-
159 void *q = value;-
160 value = 0;-
161-
162 if (destructor)
destructorDescription
TRUEevaluated 210 times by 124 tests
Evaluated by:
  • tst_QApplication
  • tst_QFontCache
  • tst_QNetworkReply
  • tst_languagechange - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qcolordialog - unknown status
  • tst_qcolumnview - unknown status
  • tst_qcombobox - unknown status
  • tst_qcommandlinkbutton - unknown status
  • tst_qcompleter - unknown status
  • tst_qcomplextext - unknown status
  • tst_qcssparser - unknown status
  • tst_qdatawidgetmapper - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdialog - unknown status
  • tst_qdialogbuttonbox - unknown status
  • ...
FALSEnever evaluated
0-210
163 destructor(q);
executed 210 times by 124 tests: destructor(q);
Executed by:
  • tst_QApplication
  • tst_QFontCache
  • tst_QNetworkReply
  • tst_languagechange - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qcolordialog - unknown status
  • tst_qcolumnview - unknown status
  • tst_qcombobox - unknown status
  • tst_qcommandlinkbutton - unknown status
  • tst_qcompleter - unknown status
  • tst_qcomplextext - unknown status
  • tst_qcssparser - unknown status
  • tst_qdatawidgetmapper - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdialog - unknown status
  • tst_qdialogbuttonbox - unknown status
  • ...
210
164 }
executed 210 times by 124 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QFontCache
  • tst_QNetworkReply
  • tst_languagechange - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qapplication - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qcolordialog - unknown status
  • tst_qcolumnview - unknown status
  • tst_qcombobox - unknown status
  • tst_qcommandlinkbutton - unknown status
  • tst_qcompleter - unknown status
  • tst_qcomplextext - unknown status
  • tst_qcssparser - unknown status
  • tst_qdatawidgetmapper - unknown status
  • tst_qdatetimeedit - unknown status
  • tst_qdialog - unknown status
  • tst_qdialogbuttonbox - unknown status
  • ...
210
165-
166 // store new data-
167 value = p;-
168 DEBUG_MSG("QThreadStorageData: Set storage %d for thread %p to %p", id, data->thread.load(), p);
dead code: QMessageLogger(__FILE__, 168, __PRETTY_FUNCTION__).debug("QThreadStorageData: Set storage %d for thread %p to %p", id, data->thread.load(), p);
-
169 return &value;
executed 12825 times by 341 tests: return &value;
Executed by:
  • tst_Compiler
  • tst_Gestures
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • tst_QAnimationGroup
  • tst_QApplication
  • tst_QAuthenticator
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • ...
12825
170}-
171-
172void QThreadStorageData::finish(void **p)-
173{-
174 QVector<void *> *tls = reinterpret_cast<QVector<void *> *>(p);-
175 if (!tls || tls->isEmpty() || !destructors())
!tlsDescription
TRUEnever evaluated
FALSEevaluated 622256 times by 584 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QAtomicInt
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFreeList
  • tst_QFtp
  • tst_QFuture
  • tst_QGlobal
  • tst_QGlobalStatic
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QGuiEventLoop
  • ...
tls->isEmpty()Description
TRUEevaluated 621238 times by 574 tests
Evaluated by:
  • tst_QApplication
  • tst_QAtomicInt
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFreeList
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlobalStatic
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QGuiEventLoop
  • tst_QHostInfo
  • tst_QLocalSocket
  • ...
FALSEevaluated 1018 times by 269 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QFuture
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QSettings
  • tst_QTcpSocket
  • tst_QUuid
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • ...
!destructors()Description
TRUEnever evaluated
FALSEevaluated 1018 times by 269 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QFuture
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QSettings
  • tst_QTcpSocket
  • tst_QUuid
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • ...
0-622256
176 return; // nothing to do
executed 621238 times by 574 tests: return;
Executed by:
  • tst_QApplication
  • tst_QAtomicInt
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusAbstractInterface
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDBusPendingCall
  • tst_QDBusThreading
  • tst_QDnsLookup_Appless
  • tst_QEventLoop
  • tst_QFileDialog2
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFreeList
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlobalStatic
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QGuiEventLoop
  • tst_QHostInfo
  • tst_QLocalSocket
  • ...
621238
177-
178 DEBUG_MSG("QThreadStorageData: Destroying storage for thread %p", QThread::currentThread());
dead code: QMessageLogger(__FILE__, 178, __PRETTY_FUNCTION__).debug("QThreadStorageData: Destroying storage for thread %p", QThread::currentThread());
-
179 while (!tls->isEmpty()) {
!tls->isEmpty()Description
TRUEevaluated 2760 times by 269 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QFuture
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QSettings
  • tst_QTcpSocket
  • tst_QUuid
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • ...
FALSEevaluated 1018 times by 269 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QFuture
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QSettings
  • tst_QTcpSocket
  • tst_QUuid
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • ...
1018-2760
180 void *&value = tls->last();-
181 void *q = value;-
182 value = 0;-
183 int i = tls->size() - 1;-
184 tls->resize(i);-
185-
186 if (!q) {
!qDescription
TRUEevaluated 1378 times by 252 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QTcpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • ...
FALSEevaluated 1382 times by 189 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QFuture
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QSettings
  • tst_QTcpSocket
  • tst_QUuid
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractspinbox - unknown status
  • ...
1378-1382
187 // data already deleted-
188 continue;
executed 1378 times by 252 tests: continue;
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QTcpSocket
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • ...
1378
189 }-
190-
191 QMutexLocker locker(&destructorsMutex);-
192 void (*destructor)(void *) = destructors()->value(i);-
193 locker.unlock();-
194-
195 if (!destructor) {
!destructorDescription
TRUEnever evaluated
FALSEevaluated 1382 times by 189 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QFuture
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QSettings
  • tst_QTcpSocket
  • tst_QUuid
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractspinbox - unknown status
  • ...
0-1382
196 if (QThread::currentThread())
QThread::currentThread()Description
TRUEnever evaluated
FALSEnever evaluated
0
197 qWarning("QThreadStorage: Thread %p exited after QThreadStorage %d destroyed",
never executed: QMessageLogger(__FILE__, 197, __PRETTY_FUNCTION__).warning("QThreadStorage: Thread %p exited after QThreadStorage %d destroyed", QThread::currentThread(), i);
0
198 QThread::currentThread(), i);
never executed: QMessageLogger(__FILE__, 197, __PRETTY_FUNCTION__).warning("QThreadStorage: Thread %p exited after QThreadStorage %d destroyed", QThread::currentThread(), i);
0
199 continue;
never executed: continue;
0
200 }-
201 destructor(q); //crash here might mean the thread exited after qthreadstorage was destroyed-
202-
203 if (tls->size() > i) {
tls->size() > iDescription
TRUEevaluated 26 times by 26 tests
Evaluated by:
  • tst_gestures - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qaccessibility - unknown status
  • tst_qcolumnview - unknown status
  • tst_qdockwidget - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qmainwindow - unknown status
  • tst_qmdiarea - unknown status
  • tst_qmdisubwindow - unknown status
  • tst_qmenu - unknown status
  • tst_qparallelanimationgroup - unknown status
  • tst_qpauseanimation - unknown status
  • tst_qprinter - unknown status
  • tst_qprogressbar - unknown status
  • tst_qpropertyanimation - unknown status
  • tst_qscroller - unknown status
  • tst_qsequentialanimationgroup - unknown status
  • tst_qshortcut - unknown status
  • tst_qstatemachine - unknown status
  • tst_qstylesheetstyle - unknown status
  • tst_qtoolbar - unknown status
  • tst_qtreeview - unknown status
  • tst_qwidget - unknown status
  • tst_qwidget_window - unknown status
  • ...
FALSEevaluated 1356 times by 189 tests
Evaluated by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QFuture
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QSettings
  • tst_QTcpSocket
  • tst_QUuid
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractspinbox - unknown status
  • ...
26-1356
204 //re reset the tls in case it has been recreated by its own destructor.-
205 (*tls)[i] = 0;-
206 }
executed 26 times by 26 tests: end of block
Executed by:
  • tst_gestures - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qaccessibility - unknown status
  • tst_qcolumnview - unknown status
  • tst_qdockwidget - unknown status
  • tst_qgraphicsproxywidget - unknown status
  • tst_qlineedit - unknown status
  • tst_qmainwindow - unknown status
  • tst_qmdiarea - unknown status
  • tst_qmdisubwindow - unknown status
  • tst_qmenu - unknown status
  • tst_qparallelanimationgroup - unknown status
  • tst_qpauseanimation - unknown status
  • tst_qprinter - unknown status
  • tst_qprogressbar - unknown status
  • tst_qpropertyanimation - unknown status
  • tst_qscroller - unknown status
  • tst_qsequentialanimationgroup - unknown status
  • tst_qshortcut - unknown status
  • tst_qstatemachine - unknown status
  • tst_qstylesheetstyle - unknown status
  • tst_qtoolbar - unknown status
  • tst_qtreeview - unknown status
  • tst_qwidget - unknown status
  • tst_qwidget_window - unknown status
  • ...
26
207 }
executed 1382 times by 189 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QFuture
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QSettings
  • tst_QTcpSocket
  • tst_QUuid
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractspinbox - unknown status
  • ...
1382
208 tls->clear();-
209}
executed 1018 times by 269 tests: end of block
Executed by:
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QDnsLookup_Appless
  • tst_QFuture
  • tst_QGuiApplication
  • tst_QHttpNetworkConnection
  • tst_QNetworkAccessManager_And_QProgressDialog
  • tst_QNetworkDiskCache
  • tst_QNetworkProxyFactory
  • tst_QNetworkReply
  • tst_QPainter
  • tst_QSettings
  • tst_QTcpSocket
  • tst_QUuid
  • tst_QXmlInputSource
  • tst_Spdy
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • ...
1018
210-
211/*!-
212 \class QThreadStorage-
213 \inmodule QtCore-
214 \brief The QThreadStorage class provides per-thread data storage.-
215-
216 \threadsafe-
217-
218 \ingroup thread-
219-
220 QThreadStorage is a template class that provides per-thread data-
221 storage.-
222-
223 The setLocalData() function stores a single thread-specific value-
224 for the calling thread. The data can be accessed later using-
225 localData().-
226-
227 The hasLocalData() function allows the programmer to determine if-
228 data has previously been set using the setLocalData() function.-
229 This is also useful for lazy initializiation.-
230-
231 If T is a pointer type, QThreadStorage takes ownership of the data-
232 (which must be created on the heap with \c new) and deletes it when-
233 the thread exits, either normally or via termination.-
234-
235 For example, the following code uses QThreadStorage to store a-
236 single cache for each thread that calls the cacheObject() and-
237 removeFromCache() functions. The cache is automatically-
238 deleted when the calling thread exits.-
239-
240 \snippet threads/threads.cpp 7-
241 \snippet threads/threads.cpp 8-
242 \snippet threads/threads.cpp 9-
243-
244 \section1 Caveats-
245-
246 \list-
247-
248 \li The QThreadStorage destructor does not delete per-thread data.-
249 QThreadStorage only deletes per-thread data when the thread exits-
250 or when setLocalData() is called multiple times.-
251-
252 \li QThreadStorage can be used to store data for the \c main()-
253 thread. QThreadStorage deletes all data set for the \c main()-
254 thread when QApplication is destroyed, regardless of whether or-
255 not the \c main() thread has actually finished.-
256-
257 \endlist-
258-
259 \sa QThread-
260*/-
261-
262/*!-
263 \fn QThreadStorage::QThreadStorage()-
264-
265 Constructs a new per-thread data storage object.-
266*/-
267-
268/*!-
269 \fn QThreadStorage::~QThreadStorage()-
270-
271 Destroys the per-thread data storage object.-
272-
273 Note: The per-thread data stored is not deleted. Any data left-
274 in QThreadStorage is leaked. Make sure that all threads using-
275 QThreadStorage have exited before deleting the QThreadStorage.-
276-
277 \sa hasLocalData()-
278*/-
279-
280/*!-
281 \fn bool QThreadStorage::hasLocalData() const-
282-
283 If T is a pointer type, returns \c true if the calling thread has-
284 non-zero data available.-
285-
286 If T is a value type, returns whether the data has already been-
287 constructed by calling setLocalData or localData.-
288-
289 \sa localData()-
290*/-
291-
292/*!-
293 \fn T &QThreadStorage::localData()-
294-
295 Returns a reference to the data that was set by the calling-
296 thread.-
297-
298 If no data has been set, this will create a default constructed-
299 instance of type T.-
300-
301 \sa hasLocalData()-
302*/-
303-
304/*!-
305 \fn const T QThreadStorage::localData() const-
306 \overload-
307-
308 Returns a copy of the data that was set by the calling thread.-
309-
310 \sa hasLocalData()-
311*/-
312-
313/*!-
314 \fn void QThreadStorage::setLocalData(T data)-
315-
316 Sets the local data for the calling thread to \a data. It can be-
317 accessed later using the localData() functions.-
318-
319 If T is a pointer type, QThreadStorage takes ownership of the data-
320 and deletes it automatically either when the thread exits (either-
321 normally or via termination) or when setLocalData() is called again.-
322-
323 \sa localData(), hasLocalData()-
324*/-
325-
326#endif // QT_NO_THREAD-
327-
328QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9