locking is required around pj_init_plus (partial revert of 2063) as it appears pj_init_plus will fail under high concurrent load even with proj 4.7.0 (only seen when reprojecting data) and will likely require use of a context (available in next release) if we wish to remove locks

This commit is contained in:
Dane Springmeyer 2010-08-27 22:05:15 +00:00
parent 12dd97a772
commit df42fcde56
2 changed files with 11 additions and 7 deletions

View file

@ -24,7 +24,7 @@ Mapnik Trunk
- Added xinclude (http://www.w3.org/TR/xinclude/) support to libxml2-based xml parser (oldtopos) (#567)
- Optimized rendering speeds by avoiding locking in the projection code (r2063)
- Optimized rendering speeds by avoiding locking in the projection code (r2063) (r2713)
- Added support for setting global alignment of polygon pattern fills (#203)
@ -47,7 +47,7 @@ Mapnik Trunk
- PNG: fixed png256 for large images and some improvements to reduce color corruptions (#522)
- Implement MarkersSymbolizer in Cairo render and improve the markers placementfinder. (#553)
- Implement MarkersSymbolizer in Cairo render and improve the markers placement finder. (#553)
Mapnik 0.7.0 Release
@ -115,9 +115,9 @@ Mapnik 0.7.0 Release
- Shape Plugin: Fixed missing compiler flags that causes crashing on newer g++ versions (#436)
- PNG: Fixed problem with garbled/striped png256 output along sharpe edges(#416,#445,#447,#202)
- PNG: Fixed problem with garbled/striped png256 output along sharp edges(#416,#445,#447,#202)
- PNG: Added support for semitransparency in png256 output (#477,#202)
- PNG: Added support for semi-transparency in png256 output (#477,#202)
- PolygonSymbolizer: Added 'gamma' attribute to allow for dilation of polygon edges - a solution
to gap artifacts or "ghost lines" between adjacent polygons and allows for slight sharpening of

View file

@ -124,10 +124,14 @@ projection::~projection()
void projection::init()
{
// http://trac.osgeo.org/proj/wiki/ThreadSafety
#if PJ_VERSION < 470 && MAPNIK_THREADSAFE
// Based on http://trac.osgeo.org/proj/wiki/ThreadSafety
// you could think pj_init was threadsafe in version 4.7.0
// but its certainly not, and must only be in >= 4.7 with
// usage of projCtx per thread
//#if PJ_VERSION < 470 && MAPNIK_THREADSAFE
// mutex::scoped_lock lock(mutex_);
//#endif
mutex::scoped_lock lock(mutex_);
#endif
proj_=pj_init_plus(params_.c_str());
if (!proj_) throw proj_init_error(params_);
is_geographic_ = pj_is_latlong(proj_) ? true : false;