Skip to content
Snippets Groups Projects
Commit aef15c23 authored by Anthony Royer's avatar Anthony Royer
Browse files

Fix data race when threads raise an error msg at the same time

parent 2adcedcf
No related branches found
No related tags found
No related merge requests found
......@@ -480,6 +480,8 @@ std::string Msg::PrintResources(bool printDate, bool printWallTime,
}
void Msg::Error(const char *fmt, ...)
{
#pragma omp critical(MsgError)
{
_errorCount++;
_atLeastOneErrorInRun = 1;
......@@ -534,8 +536,11 @@ void Msg::Error(const char *fmt, ...)
Exit(1);
}
}
}
void Msg::Warning(const char *fmt, ...)
{
#pragma omp critical(MsgWarning)
{
_warningCount++;
......@@ -575,11 +580,13 @@ void Msg::Warning(const char *fmt, ...)
fflush(stderr);
}
}
}
void Msg::Info(const char *fmt, ...)
{
if(GetVerbosity() < 4) return;
#pragma omp critical(MsgInfo)
{
char str[5000];
va_list args;
va_start(args, fmt);
......@@ -617,6 +624,7 @@ void Msg::Info(const char *fmt, ...)
fflush(stdout);
}
}
}
void Msg::RequestRender()
{
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment