Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:32:08

0001 #include "Utilities/Xerces/interface/Xerces.h"
0002 #include <xercesc/parsers/XercesDOMParser.hpp>
0003 #include <vector>
0004 #include <thread>
0005 #include <iostream>
0006 
0007 XERCES_CPP_NAMESPACE_USE
0008 
0009 void testInit() {
0010   cms::concurrency::xercesInitialize();
0011   {
0012     std::cerr << std::this_thread::get_id() << std::endl;
0013     XercesDOMParser parser;
0014   }
0015   cms::concurrency::xercesTerminate();
0016 }
0017 
0018 int main() {
0019   std::vector<std::thread> threads;
0020   threads.emplace_back(testInit);
0021   threads.emplace_back(testInit);
0022   threads.emplace_back(testInit);
0023   threads.emplace_back(testInit);
0024 
0025   for (auto &thread : threads)
0026     thread.join();
0027 }