CMS 3D CMS Logo

Xerces.cc
Go to the documentation of this file.
2 #include <xercesc/util/PlatformUtils.hpp>
3 #include <mutex>
4 #include <thread>
5 
7 
8 namespace cms {
9  namespace concurrency {
10  namespace {
11  std::mutex g_xerces_mutex;
12  }
13  // We need to make sure these serialized are only called by one
14  // thread at the time. Until the first Init succeeds the other threads
15  // should not be allowed to proceed. We also do not want two different
16  // threads calling Init and Finalize at the same time. We therefore simply
17  // use a global mutex to serialize everything.
19  std::unique_lock<std::mutex> l(g_xerces_mutex);
20  XMLPlatformUtils::Initialize();
21  }
22 
23  void xercesTerminate() {
24  std::unique_lock<std::mutex> l(g_xerces_mutex);
25  XMLPlatformUtils::Terminate();
26  }
27  } // namespace concurrency
28 } // namespace cms
void xercesTerminate()
Definition: Xerces.cc:23
static std::mutex mutex
Definition: Proxy.cc:8
void xercesInitialize()
Definition: Xerces.cc:18
Namespace of DDCMS conversion namespace.