MCPcopy Create free account
hub / github.com/OSGeo/gdal / ChunkThreadMain

Function ChunkThreadMain

alg/gdalwarpoperation.cpp:1141–1186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1139};
1140
1141static void ChunkThreadMain(void *pThreadData)
1142
1143{
1144 volatile ChunkThreadData *psData =
1145 static_cast<volatile ChunkThreadData *>(pThreadData);
1146
1147 GDALWarpChunk *pasChunkInfo = psData->pasChunkInfo;
1148
1149 /* -------------------------------------------------------------------- */
1150 /* Acquire IO mutex. */
1151 /* -------------------------------------------------------------------- */
1152 if (!CPLAcquireMutex(psData->hIOMutex, 600.0))
1153 {
1154 CPLError(CE_Failure, CPLE_AppDefined,
1155 "Failed to acquire IOMutex in WarpRegion().");
1156 psData->eErr = CE_Failure;
1157 }
1158 else
1159 {
1160 if (psData->hCond != nullptr)
1161 {
1162 CPLAcquireMutex(psData->hCondMutex, 1.0);
1163 psData->bIOMutexTaken = TRUE;
1164 CPLCondSignal(psData->hCond);
1165 CPLReleaseMutex(psData->hCondMutex);
1166 }
1167
1168 auto oAccumulator =
1169 psData->poErrorAccumulator->InstallForCurrentScope();
1170 CPL_IGNORE_RET_VAL(oAccumulator);
1171
1172 psData->eErr = psData->poOperation->WarpRegion(
1173 pasChunkInfo->dx, pasChunkInfo->dy, pasChunkInfo->dsx,
1174 pasChunkInfo->dsy, pasChunkInfo->sx, pasChunkInfo->sy,
1175 pasChunkInfo->ssx, pasChunkInfo->ssy, pasChunkInfo->sExtraSx,
1176 pasChunkInfo->sExtraSy, psData->dfProgressBase,
1177 psData->dfProgressScale);
1178
1179 /* --------------------------------------------------------------------
1180 */
1181 /* Release the IO mutex. */
1182 /* --------------------------------------------------------------------
1183 */
1184 CPLReleaseMutex(psData->hIOMutex);
1185 }
1186}
1187
1188/************************************************************************/
1189/* ChunkAndWarpMulti() */

Callers

nothing calls this directly

Calls 7

CPLAcquireMutexFunction · 0.85
CPLErrorFunction · 0.85
CPLCondSignalFunction · 0.85
CPLReleaseMutexFunction · 0.85
WarpRegionMethod · 0.80
CPL_IGNORE_RET_VALFunction · 0.50

Tested by

no test coverage detected