The output stream formatting is not thread-safe in g++-3.2.3-20030504-1.
This is the case for example for std::stringstream and std::ofstream,
for operator << (int).
It uses the setlocale() function from msvcrt.dll, which is not thread-safe.
The patch is in attachement.
Note: The bug is resolved in g++ 3.4.5, but I couldn't get a working
libstdc++ dll with that version.
It is also resolved in g++ 4.2.1, but this version also has other bugs.
Chief Software Engineer
8 chemin des étoiles
Voice: +32 (0)10 48.00.68
Fax: +32 (0)10 48.00.69