File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,17 @@ Cv64suf;
327
327
# endif
328
328
#endif
329
329
330
+ /* ***************************************************************************************\
331
+ * Thread sanitizer *
332
+ \****************************************************************************************/
333
+ #ifndef CV_THREAD_SANITIZER
334
+ # if defined(__has_feature)
335
+ # if __has_feature(thread_sanitizer)
336
+ # define CV_THREAD_SANITIZER
337
+ # endif
338
+ # endif
339
+ #endif
340
+
330
341
/* ***************************************************************************************\
331
342
* exchange-add operation for atomic operations on reference counters *
332
343
\****************************************************************************************/
Original file line number Diff line number Diff line change @@ -1396,7 +1396,9 @@ class TlsStorage
1396
1396
// Get data by TLS storage index
1397
1397
void * getData (size_t slotIdx) const
1398
1398
{
1399
+ #ifndef CV_THREAD_SANITIZER
1399
1400
CV_Assert (tlsSlotsSize > slotIdx);
1401
+ #endif
1400
1402
1401
1403
ThreadData* threadData = (ThreadData*)tls.GetData ();
1402
1404
if (threadData && threadData->slots .size () > slotIdx)
@@ -1426,7 +1428,9 @@ class TlsStorage
1426
1428
// Set data to storage index
1427
1429
void setData (size_t slotIdx, void * pData)
1428
1430
{
1431
+ #ifndef CV_THREAD_SANITIZER
1429
1432
CV_Assert (tlsSlotsSize > slotIdx);
1433
+ #endif
1430
1434
1431
1435
ThreadData* threadData = (ThreadData*)tls.GetData ();
1432
1436
if (!threadData)
You can’t perform that action at this time.
0 commit comments