Opened 14 years ago

Closed 14 years ago

#1463 closed defect (fixed)

Access to the CsMap coordinate system dictionary files is not correctly protected by the Mg API

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.

Attachments (1)

FixNonGlobalCriticalSection_1463.patch (9.0 KB ) - added by baertelchen 14 years ago.
Patch that adds the CriticalSection implementation in its own file, updates to the makefile and the VS project file

Download all attachments as: .zip

Change History (4)

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

comment:2 by brucedechant, 14 years ago

Milestone: 2.3

comment:3 by brucedechant, 14 years ago

Resolution: fixed
Status: newclosed

Submitted r5295

Note: See TracTickets for help on using tickets.