Opened 14 years ago

Last modified 14 years ago

#1463 closed defect

Access to the CsMap coordinate system dictionary files is not correctly protected by the Mg API — at Initial Version

Reported by: baertelchen Owned by:
Priority: low Milestone: 2.3
Component: General Version: 2.1.0
Severity: minor Keywords: Coordinate System API
Cc: External ID:

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 CriticalClass into a separate source file and declares it [extern] in the header.

Change History (1)

by baertelchen, 14 years ago

Patch that adds the CriticalSection implementation in its own file, updates to the makefile and the VS project file

Note: See TracTickets for help on using tickets.