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 Version 1

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

Description (last modified by brucedechant)

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.

Change History (2)

by baertelchen, 14 years ago

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

comment:1 by brucedechant, 14 years ago

Description: modified (diff)
Owner: set to brucedechant
Note: See TracTickets for help on using tickets.