Commit d35422b5 authored by Alexander Alekhin's avatar Alexander Alekhin

core(tls): hide assertions from Thread Sanitizer

parent 68ef903a
...@@ -327,6 +327,17 @@ Cv64suf; ...@@ -327,6 +327,17 @@ Cv64suf;
# endif # endif
#endif #endif
/****************************************************************************************\
* Thread sanitizer *
\****************************************************************************************/
#ifndef CV_THREAD_SANITIZER
# if defined(__has_feature)
# if __has_feature(thread_sanitizer)
# define CV_THREAD_SANITIZER
# endif
# endif
#endif
/****************************************************************************************\ /****************************************************************************************\
* exchange-add operation for atomic operations on reference counters * * exchange-add operation for atomic operations on reference counters *
\****************************************************************************************/ \****************************************************************************************/
......
...@@ -1396,7 +1396,9 @@ public: ...@@ -1396,7 +1396,9 @@ public:
// Get data by TLS storage index // Get data by TLS storage index
void* getData(size_t slotIdx) const void* getData(size_t slotIdx) const
{ {
#ifndef CV_THREAD_SANITIZER
CV_Assert(tlsSlotsSize > slotIdx); CV_Assert(tlsSlotsSize > slotIdx);
#endif
ThreadData* threadData = (ThreadData*)tls.GetData(); ThreadData* threadData = (ThreadData*)tls.GetData();
if(threadData && threadData->slots.size() > slotIdx) if(threadData && threadData->slots.size() > slotIdx)
...@@ -1426,7 +1428,9 @@ public: ...@@ -1426,7 +1428,9 @@ public:
// Set data to storage index // Set data to storage index
void setData(size_t slotIdx, void* pData) void setData(size_t slotIdx, void* pData)
{ {
#ifndef CV_THREAD_SANITIZER
CV_Assert(tlsSlotsSize > slotIdx); CV_Assert(tlsSlotsSize > slotIdx);
#endif
ThreadData* threadData = (ThreadData*)tls.GetData(); ThreadData* threadData = (ThreadData*)tls.GetData();
if(!threadData) if(!threadData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment