Archived issue #0022933
Thread-safe locale handling in OSD_Localizer
Description
Thread-safe. There is a discussion on this topic at:
[1] http://dev.opencascade.org/index.php?q=node/35
[2] #0022898
[3] #0022808
The changed implementation of OSD_Localizer uses uselocale() or _configthreadlocale() (on Windows, that seems to miss uselocale) as described in [3].
It also implements the suggestion of Markus Rhein [3] to reset the locale in the destructor. Since the function Restore() is no longer needed, it is removed.
I removed also the functions SetLocale(), Locale() and Category() since they are used nowhere.
I have changed the (up to now) only occurrence of OSD_Localizer in OpenGl_GraphicDriver_Export.cxx to work with the new implementation.
I have not done anything to the cdl-file, since I miss knowledge on this.
It seems to work on my system (Debian Squeeze, 32bit), but other platforms have to be tested too.
If think you want to add relationship to 0022808 and 0022898. They can be easily resolved after this one.
[1] http://dev.opencascade.org/index.php?q=node/35
[2] #0022898
[3] #0022808
The changed implementation of OSD_Localizer uses uselocale() or _configthreadlocale() (on Windows, that seems to miss uselocale) as described in [3].
It also implements the suggestion of Markus Rhein [3] to reset the locale in the destructor. Since the function Restore() is no longer needed, it is removed.
I removed also the functions SetLocale(), Locale() and Category() since they are used nowhere.
I have changed the (up to now) only occurrence of OSD_Localizer in OpenGl_GraphicDriver_Export.cxx to work with the new implementation.
I have not done anything to the cdl-file, since I miss knowledge on this.
It seems to work on my system (Debian Squeeze, 32bit), but other platforms have to be tested too.
If think you want to add relationship to 0022808 and 0022898. They can be easily resolved after this one.
Public activity
2 archived notes
Participants are labeled by their role within this record.
Dear Commenter 1,
the suggested changes (thread-safe locale handling) were done within #0022898 patch. Please close the bug.
Standard_CLocaleSentry is a new replacement for removed OSD_Localizer and now intended only for temporary switch C runtime library locale to "C" locale.
the suggested changes (thread-safe locale handling) were done within #0022898 patch. Please close the bug.
Standard_CLocaleSentry is a new replacement for removed OSD_Localizer and now intended only for temporary switch C runtime library locale to "C" locale.
Problem has been corrected by fix for 0022898 issue
Related records