1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #27677 from kallaballa:data_races_in_ocl_cpp2

Added source comments to mark TSAN false positives
This commit is contained in:
Alexander Smorkalov
2025-08-29 13:13:03 +03:00
committed by GitHub
+5
View File
@@ -3500,8 +3500,10 @@ struct Kernel::Impl
void addUMat(const UMat& m, bool dst)
{
// TSAN false positive: see #27638
CV_Assert(nu < MAX_ARRS && m.u && m.u->urefcount > 0);
u[nu] = m.u;
// TSAN false positive: see #27638
CV_XADD(&m.u->urefcount, 1);
nu++;
if(dst && m.u->tempUMat())
@@ -5670,6 +5672,7 @@ public:
if(!u)
return;
// Next two lines: TSAN false positive: see #27638
CV_Assert(u->urefcount == 0);
CV_Assert(u->refcount == 0 && "UMat deallocation error: some derived Mat is still alive");
@@ -6602,11 +6605,13 @@ public:
void flushCleanupQueue() const
{
// TSAN false positive: see #27638
if (!cleanupQueue.empty())
{
std::deque<UMatData*> q;
{
cv::AutoLock lock(cleanupQueueMutex);
// TSAN false positive: see #27638
q.swap(cleanupQueue);
}
for (std::deque<UMatData*>::const_iterator i = q.begin(); i != q.end(); ++i)