Move to explicitly included properties for the include and library path.
[shibboleth/cpp-xmltooling.git] / xmltooling / internal.h
index d441ad4..bf879f3 100644 (file)
@@ -28,6 +28,7 @@
 #ifdef WIN32
 # define _CRT_SECURE_NO_DEPRECATE 1
 # define _CRT_NONSTDC_NO_DEPRECATE 1
+# define _SCL_SECURE_NO_WARNINGS 1
 #endif
 
 // Export public APIs.
 #include "XMLToolingConfig.h"
 #include "util/ParserPool.h"
 
+#include <map>
+#include <string>
 #include <vector>
+
 #ifndef XMLTOOLING_NO_XMLSEC
     #include <xsec/framework/XSECProvider.hpp>
 #endif
@@ -95,6 +99,9 @@ namespace xmltooling {
         Lockable* lock();
         void unlock();
 
+        // named mutexes to limit lock scope
+        Mutex& getNamedMutex(const char* name);
+
         // configuration
         bool load_library(const char* path, void* context=nullptr);
         bool log_config(const char* config=nullptr);
@@ -125,7 +132,8 @@ namespace xmltooling {
 
     private:
         int m_initCount;
-        Mutex* m_lock;
+        std::auto_ptr<Mutex> m_lock;
+        std::map<std::string,Mutex*> m_namedLocks;
         std::vector<void*> m_libhandles;
         ParserPool* m_parserPool;
         ParserPool* m_validatingPool;