Utilities
Xerces
src
Xerces.cc
Go to the documentation of this file.
1
#include "
Utilities/Xerces/interface/Xerces.h
"
2
#include <xercesc/util/PlatformUtils.hpp>
3
#include <mutex>
4
#include <thread>
5
6
XERCES_CPP_NAMESPACE_USE
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.
18
void
xercesInitialize
() {
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
XERCES_CPP_NAMESPACE_USE
Definition:
XMLConfigWriter.cc:40
Xerces.h
mutex
static std::mutex mutex
Definition:
Proxy.cc:8
cms::concurrency::xercesTerminate
void xercesTerminate()
Definition:
Xerces.cc:23
cmsLHEtoEOSManager.l
l
Definition:
cmsLHEtoEOSManager.py:204
cms::concurrency::xercesInitialize
void xercesInitialize()
Definition:
Xerces.cc:18
cms
Namespace of DDCMS conversion namespace.
Definition:
ProducerAnalyzer.cc:21
Generated for CMSSW Reference Manual by
1.8.16