[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
Tue Oct 19 12:16:53 EDT 2010
#1463: Access to the CsMap coordinate system dictionary files is not correctly
protected by the Mg API
---------------------------+------------------------------------------------
Reporter: baertelchen | Owner: brucedechant
Type: defect | Status: new
Priority: low | Milestone:
Component: General | Version: 2.1.0
Severity: minor | Keywords: Coordinate System API
External_id: |
---------------------------+------------------------------------------------
Changes (by brucedechant):
* owner: => brucedechant
Old description:
> 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.
New description:
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.
The attached patch moves the !CriticalClass into a separate source file
and declares it [extern] in the header.
--
--
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/1463#comment:1>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals
More information about the mapguide-trac
mailing list