#3992 Fixed memory overwrite (and arbitrary crashes) due to missing critical section.

The critical section is needed when doing geometry transfer from libecl in paralell.
Caused arbitrary crashes in completely unrelated code when compiled in release on a 32-core machine on windows
This commit is contained in:
Jacob Støren 2019-01-25 12:27:43 +01:00
parent 49a6650e77
commit b329f3acc7

View File

@ -94,9 +94,12 @@ void RigActiveCellInfo::setCellResultIndex(size_t reservoirCellIndex, size_t res
m_cellIndexToResultIndex[reservoirCellIndex] = reservoirCellResultIndex;
if (reservoirCellResultIndex >= m_reservoirCellResultCount)
#pragma omp critical
{
m_reservoirCellResultCount = reservoirCellResultIndex + 1;
if ( reservoirCellResultIndex >= m_reservoirCellResultCount )
{
m_reservoirCellResultCount = reservoirCellResultIndex + 1;
}
}
}