diff options
Diffstat (limited to 'src/transformations/hgridshift.cpp')
| -rw-r--r-- | src/transformations/hgridshift.cpp | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/transformations/hgridshift.cpp b/src/transformations/hgridshift.cpp index 326bbb13..96b77c20 100644 --- a/src/transformations/hgridshift.cpp +++ b/src/transformations/hgridshift.cpp @@ -6,31 +6,16 @@ #include <time.h> #include "proj_internal.h" +#include "proj/internal/mutex.hpp" #include "grids.hpp" PROJ_HEAD(hgridshift, "Horizontal grid shift"); -using namespace NS_PROJ; - -#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(); } -}; -} -#else -#include <mutex> -#define MyMutex std::mutex -#endif - -static MyMutex gMutex{}; +static NS_PROJ::mutex gMutex{}; static std::set<std::string> gKnownGrids{}; +using namespace NS_PROJ; + namespace { // anonymous namespace struct hgridshiftData { double t_final = 0; @@ -208,7 +193,6 @@ PJ *TRANSFORMATION(hgridshift,0) { } void pj_clear_hgridshift_knowngrids_cache() { - gMutex.lock(); + NS_PROJ::lock_guard<NS_PROJ::mutex> lock(gMutex); gKnownGrids.clear(); - gMutex.unlock(); } |
