Skip to content

Commit

Permalink
Merge pull request OSGeo#10757 from rouault/try_fix_test_ogr_gpkg_arr…
Browse files Browse the repository at this point in the history
…ow_stream_huge_array

OGR_GPKG_FillArrowArray_Step(): more rigourous locking to perhaps fix…
  • Loading branch information
rouault authored Sep 10, 2024
2 parents 91ef2f1 + 31ddb3c commit b986fba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7805,12 +7805,13 @@ void OGR_GPKG_FillArrowArray_Step(sqlite3_context *pContext, int /*argc*/,
const int SQLITE_MAX_FUNCTION_ARG =
sqlite3_limit(psFillArrowArray->hDB, SQLITE_LIMIT_FUNCTION_ARG, -1);
begin:
const int iFeat = [psFillArrowArray]()
int iFeat;
OGRArrowArrayHelper *psHelper;
{
std::unique_lock<std::mutex> oLock(psFillArrowArray->oMutex);
return psFillArrowArray->nCountRows;
}();
auto psHelper = psFillArrowArray->psHelper.get();
iFeat = psFillArrowArray->nCountRows;
psHelper = psFillArrowArray->psHelper.get();
}
int iCol = 0;
const int iFieldStart = sqlite3_value_int(argv[iCol]);
++iCol;
Expand Down

0 comments on commit b986fba

Please sign in to comment.