|
From: Jeremy G. <jn...@nt...> - 2003-09-22 16:56:24
|
Hi,
The following code is crashing:
#include <sstream>
#include <windows.h>
unsigned long __stdcall threadFunc(void* pThis)
{
while (1)
{
std::ostringstream strm;
strm << 999;
}
}
int main(int argc, char* argv[])
{
::CreateThread(NULL, 0, threadFunc, 0, 0, NULL);
::CreateThread(NULL, 0, threadFunc, 0, 0, NULL);
while (1)
::Sleep(1000);
}
It seems that the numeric output to the stringstream is not thread safe.
Character output seems to be OK. Does anyone know anything about this? I'm
compiling with -mthreads -g.
Regards
Jeremy Godfrey
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003
|