fix TLS implementation (closes #5967)
This commit is contained in:
parent
3d2fc6c2fd
commit
c7ccde69a8
@ -1084,6 +1084,8 @@ public:
|
|||||||
CV_Assert(tlsSlots.size() > slotIdx);
|
CV_Assert(tlsSlots.size() > slotIdx);
|
||||||
|
|
||||||
for(size_t i = 0; i < threads.size(); i++)
|
for(size_t i = 0; i < threads.size(); i++)
|
||||||
|
{
|
||||||
|
if(threads[i])
|
||||||
{
|
{
|
||||||
std::vector<void*>& thread_slots = threads[i]->slots;
|
std::vector<void*>& thread_slots = threads[i]->slots;
|
||||||
if (thread_slots.size() > slotIdx && thread_slots[slotIdx])
|
if (thread_slots.size() > slotIdx && thread_slots[slotIdx])
|
||||||
@ -1092,6 +1094,7 @@ public:
|
|||||||
threads[i]->slots[slotIdx] = 0;
|
threads[i]->slots[slotIdx] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tlsSlots[slotIdx] = 0;
|
tlsSlots[slotIdx] = 0;
|
||||||
}
|
}
|
||||||
@ -1115,12 +1118,15 @@ public:
|
|||||||
CV_Assert(tlsSlots.size() > slotIdx);
|
CV_Assert(tlsSlots.size() > slotIdx);
|
||||||
|
|
||||||
for(size_t i = 0; i < threads.size(); i++)
|
for(size_t i = 0; i < threads.size(); i++)
|
||||||
|
{
|
||||||
|
if(threads[i])
|
||||||
{
|
{
|
||||||
std::vector<void*>& thread_slots = threads[i]->slots;
|
std::vector<void*>& thread_slots = threads[i]->slots;
|
||||||
if (thread_slots.size() > slotIdx && thread_slots[slotIdx])
|
if (thread_slots.size() > slotIdx && thread_slots[slotIdx])
|
||||||
dataVec.push_back(thread_slots[slotIdx]);
|
dataVec.push_back(thread_slots[slotIdx]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set data to storage index
|
// Set data to storage index
|
||||||
void setData(size_t slotIdx, void* pData)
|
void setData(size_t slotIdx, void* pData)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user