MCPcopy Index your code
hub / github.com/MapServer/MapServer / msConnPoolRelease

Function msConnPoolRelease

mappool.c:399–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397/************************************************************************/
398
399void msConnPoolRelease( layerObj *layer, void *conn_handle )
400
401{
402 int i;
403
404 if( layer->debug )
405 msDebug( "msConnPoolRelease(%s,%s,%p)\n",
406 layer->name, layer->connection, conn_handle );
407
408 if( layer->connection == NULL )
409 return;
410
411 msAcquireLock( TLOCK_POOL );
412 for( i = 0; i < connectionCount; i++ )
413 {
414 connectionObj *conn = connections + i;
415
416 if( layer->connectiontype == conn->connectiontype
417 && strcasecmp( layer->connection, conn->connection ) == 0
418 && conn->conn_handle == conn_handle )
419 {
420 conn->ref_count--;
421 conn->last_used = time(NULL);
422
423 if( conn->ref_count == 0 )
424 conn->thread_id = 0;
425
426 if( conn->ref_count == 0 && (conn->lifespan == MS_LIFE_ZEROREF || conn->lifespan == MS_LIFE_SINGLE) )
427 msConnPoolClose( i );
428
429 msReleaseLock( TLOCK_POOL );
430 return;
431 }
432 }
433
434 msReleaseLock( TLOCK_POOL );
435
436 msDebug( "%s: Unable to find handle for layer '%s'.\n",
437 "msConnPoolRelease()",
438 layer->name );
439
440 msSetError( MS_MISCERR,
441 "Unable to find handle for layer '%s'.",
442 "msConnPoolRelease()",
443 layer->name );
444}
445
446/************************************************************************/
447/* msConnPoolMapCloseUnreferenced() */

Callers 7

msOGRFileOpenFunction · 0.85
msOGRFileCloseFunction · 0.85
msPostGISFreeLayerInfoFunction · 0.85
msMSSQL2008LayerCloseFunction · 0.85
msSDELayerCloseFunction · 0.85

Calls 6

msDebugFunction · 0.85
msAcquireLockFunction · 0.85
strcasecmpFunction · 0.85
msConnPoolCloseFunction · 0.85
msReleaseLockFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected