diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-06-02 19:06:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-02 19:06:15 +0200 |
| commit | 29f849485bf2ea9caa7ca3da7d93ece1daf4d7d5 (patch) | |
| tree | f0180f6659f9c060395a9eee010f18861dbad19b /src/networkfilemanager.cpp | |
| parent | a77df0d81bdfb12ef090bc53ed70219f293c04d1 (diff) | |
| parent | e297475f0d05b3c8cfbc5cee90add7d7a37c6a02 (diff) | |
| download | PROJ-29f849485bf2ea9caa7ca3da7d93ece1daf4d7d5.tar.gz PROJ-29f849485bf2ea9caa7ca3da7d93ece1daf4d7d5.zip | |
Merge pull request #2736 from rouault/cleanup_mutex
Cleanup: add proj/internal/mutex.hpp as compat layer for mingw32 for std::mutex
Diffstat (limited to 'src/networkfilemanager.cpp')
| -rw-r--r-- | src/networkfilemanager.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/networkfilemanager.cpp b/src/networkfilemanager.cpp index fa6375b8..d331f4d6 100644 --- a/src/networkfilemanager.cpp +++ b/src/networkfilemanager.cpp @@ -40,25 +40,10 @@ #include "proj.h" #include "proj/internal/internal.hpp" #include "proj/internal/lru_cache.hpp" +#include "proj/internal/mutex.hpp" #include "proj_internal.h" #include "sqlite3_utils.hpp" -#ifdef __MINGW32__ -// mingw32-win32 doesn't implement std::mutex -namespace { -class MyMutex { - public: - // cppcheck-suppress functionStatic - void lock() { pj_acquire_lock(); } - // cppcheck-suppress functionStatic - void unlock() { pj_release_lock(); } -}; -} // namespace -#else -#include <mutex> -#define MyMutex std::mutex -#endif - #ifdef CURL_ENABLED #include <curl/curl.h> #include <sqlite3.h> // for sqlite3_snprintf @@ -152,7 +137,7 @@ class NetworkChunkCache { }; lru11::Cache< - Key, std::shared_ptr<std::vector<unsigned char>>, MyMutex, + Key, std::shared_ptr<std::vector<unsigned char>>, NS_PROJ::mutex, std::unordered_map< Key, typename std::list<lru11::KeyValuePair< @@ -176,7 +161,7 @@ class NetworkFilePropertiesCache { void clearMemoryCache(); private: - lru11::Cache<std::string, FileProperties, MyMutex> cache_{}; + lru11::Cache<std::string, FileProperties, NS_PROJ::mutex> cache_{}; }; // --------------------------------------------------------------------------- |
