[mapguide-trac] #1463: Access to the CsMap coordinate system dictionary files is not correctly protected by the Mg API

MapGuide Open Source trac_mapguide at osgeo.org
Wed Oct 13 05:28:44 EDT 2010


#1463: Access to the CsMap coordinate system dictionary files is not correctly
protected by the Mg API
---------------------------+------------------------------------------------
   Reporter:  baertelchen  |       Owner:                       
       Type:  defect       |      Status:  new                  
   Priority:  low          |   Milestone:                       
  Component:  General      |     Version:  2.1.0                
   Severity:  minor        |    Keywords:  Coordinate System API
External_id:               |  
---------------------------+------------------------------------------------
 See the CriticalSection.h in \MgDev\OS\Common\CoordinateSystem:

 There exists the class CustomCriticalSection and a static variable of that
 class is defined, too.

 [static CustomCriticalSection CriticalClass;]

 This one has internal linkage, however; i.e. each object file this header
 is compiled into, will have it's own instance of [CriticalClass].

 The problem surfaces, when trying to read all available coordinate systems
 from multiple threads. The Mg API will eventually fail, because CsMap is
 not thread-safe.

 Originally, only one instance existed only.

 The attached patch moves the [CustomCriticalSection CriticalClass] into a
 separate source file and declares it [extern] in the header.

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1463>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list