Skip to content

Commit

Permalink
Merge pull request #14515 from Dr15Jones/threadSafetyTinyXML
Browse files Browse the repository at this point in the history
Changed global bool in TinyXML to be atomic
  • Loading branch information
cmsbuild committed May 17, 2016
2 parents 1550b93 + 5f83334 commit 7ee9947
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion FWCore/Utilities/interface/tinyxml.h
Expand Up @@ -44,6 +44,7 @@ so fixed them to return a reference to the object.
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <atomic>

// Help out windows:
#if defined( _DEBUG ) && !defined( DEBUG )
Expand Down Expand Up @@ -414,7 +415,7 @@ class TiXmlBase

};
static Entity entity[ NUM_ENTITY ];
static bool condenseWhiteSpace;
static std::atomic<bool> condenseWhiteSpace;
};


Expand Down
2 changes: 1 addition & 1 deletion FWCore/Utilities/src/tinyxml.cc
Expand Up @@ -40,7 +40,7 @@ distribution.

#include <boost/lexical_cast.hpp>

bool TiXmlBase::condenseWhiteSpace = true;
std::atomic<bool> TiXmlBase::condenseWhiteSpace{true};

// Microsoft compiler security
FILE* TiXmlFOpen( const char* filename, const char* mode )
Expand Down

0 comments on commit 7ee9947

Please sign in to comment.