Always activate thread safety if possible
This commit is contained in:
@@ -50,7 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "Importer.h"
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#ifdef AI_C_THREADSAFE
|
||||
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
||||
# include <boost/thread/thread.hpp>
|
||||
# include <boost/thread/mutex.hpp>
|
||||
#endif
|
||||
@@ -87,7 +87,7 @@ namespace Assimp
|
||||
}
|
||||
|
||||
|
||||
#ifdef AI_C_THREADSAFE
|
||||
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
||||
/** Global mutex to manage the access to the logstream map */
|
||||
static boost::mutex gLogStreamMutex;
|
||||
#endif
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
}
|
||||
|
||||
~LogToCallbackRedirector() {
|
||||
#ifdef AI_C_THREADSAFE
|
||||
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
||||
boost::mutex::scoped_lock lock(gLogStreamMutex);
|
||||
#endif
|
||||
// (HACK) Check whether the 'stream.user' pointer points to a
|
||||
@@ -337,7 +337,7 @@ ASSIMP_API void aiAttachLogStream( const aiLogStream* stream )
|
||||
{
|
||||
ASSIMP_BEGIN_EXCEPTION_REGION();
|
||||
|
||||
#ifdef AI_C_THREADSAFE
|
||||
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
||||
boost::mutex::scoped_lock lock(gLogStreamMutex);
|
||||
#endif
|
||||
|
||||
@@ -356,7 +356,7 @@ ASSIMP_API aiReturn aiDetachLogStream( const aiLogStream* stream)
|
||||
{
|
||||
ASSIMP_BEGIN_EXCEPTION_REGION();
|
||||
|
||||
#ifdef AI_C_THREADSAFE
|
||||
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
||||
boost::mutex::scoped_lock lock(gLogStreamMutex);
|
||||
#endif
|
||||
// find the logstream associated with this data
|
||||
@@ -381,7 +381,7 @@ ASSIMP_API aiReturn aiDetachLogStream( const aiLogStream* stream)
|
||||
ASSIMP_API void aiDetachAllLogStreams(void)
|
||||
{
|
||||
ASSIMP_BEGIN_EXCEPTION_REGION();
|
||||
#ifdef AI_C_THREADSAFE
|
||||
#ifndef ASSIMP_BUILD_SINGLETHREADED
|
||||
boost::mutex::scoped_lock lock(gLogStreamMutex);
|
||||
#endif
|
||||
for (LogStreamMap::iterator it = gActiveLogStreams.begin(); it != gActiveLogStreams.end(); ++it) {
|
||||
|
||||
Reference in New Issue
Block a user