|
@@ -318,9 +318,13 @@ bool DefaultLogger::attachStream(LogStream *pStream, unsigned int severity) {
|
|
|
}
|
|
|
|
|
|
if (0 == severity) {
|
|
|
- severity = Logger::Info | Logger::Err | Logger::Warn | Logger::Debugging;
|
|
|
+ severity = SeverityAll;
|
|
|
}
|
|
|
|
|
|
+#ifndef ASSIMP_BUILD_SINGLETHREADED
|
|
|
+ std::lock_guard<std::mutex> lock(m_arrayMutex);
|
|
|
+#endif
|
|
|
+
|
|
|
for (StreamIt it = m_StreamArray.begin();
|
|
|
it != m_StreamArray.end();
|
|
|
++it) {
|
|
@@ -346,6 +350,10 @@ bool DefaultLogger::detachStream(LogStream *pStream, unsigned int severity) {
|
|
|
severity = SeverityAll;
|
|
|
}
|
|
|
|
|
|
+#ifndef ASSIMP_BUILD_SINGLETHREADED
|
|
|
+ std::lock_guard<std::mutex> lock(m_arrayMutex);
|
|
|
+#endif
|
|
|
+
|
|
|
bool res(false);
|
|
|
for (StreamIt it = m_StreamArray.begin(); it != m_StreamArray.end(); ++it) {
|
|
|
if ((*it)->m_pStream == pStream) {
|
|
@@ -385,6 +393,10 @@ DefaultLogger::~DefaultLogger() {
|
|
|
void DefaultLogger::WriteToStreams(const char *message, ErrorSeverity ErrorSev) {
|
|
|
ai_assert(nullptr != message);
|
|
|
|
|
|
+#ifndef ASSIMP_BUILD_SINGLETHREADED
|
|
|
+ std::lock_guard<std::mutex> lock(m_arrayMutex);
|
|
|
+#endif
|
|
|
+
|
|
|
// Check whether this is a repeated message
|
|
|
auto thisLen = ::strlen(message);
|
|
|
if (thisLen == lastLen - 1 && !::strncmp(message, lastMsg, lastLen - 1)) {
|