From d32ba0538d7cb4f69cac15d2b3f15d745133a32d Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Thu, 26 Jan 2023 19:30:24 +0100 Subject: [PATCH] fix the read/write lock on Windows --- src/runtime/c/pgf/db.cxx | 2 +- src/runtime/c/pgf/pgf.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/c/pgf/db.cxx b/src/runtime/c/pgf/db.cxx index 13992dc7e..29817a3b3 100644 --- a/src/runtime/c/pgf/db.cxx +++ b/src/runtime/c/pgf/db.cxx @@ -1752,7 +1752,7 @@ void PgfDB::resize_map(size_t new_size, bool writeable) unsigned __int32 temp = ms->rwlock; if (AllClear(temp)) { if (InterlockedCompareExchange(&ms->rwlock, SetWriter(temp, true), temp) == temp) - return; + break; else continue; } else { diff --git a/src/runtime/c/pgf/pgf.h b/src/runtime/c/pgf/pgf.h index dbbbcb6a2..5d01a1ff6 100644 --- a/src/runtime/c/pgf/pgf.h +++ b/src/runtime/c/pgf/pgf.h @@ -13,8 +13,8 @@ #define PGF_API_DECL EXTERN_C __declspec(dllexport) #define PGF_API EXTERN_C __declspec(dllexport) #elif defined(COMPILING_STATIC_PGF) -#define PGF_API_DECL EXTERN_C __declspec(dllexport) -#define PGF_API EXTERN_C __declspec(dllexport) +#define PGF_API_DECL EXTERN_C +#define PGF_API EXTERN_C #else #define PGF_API_DECL __declspec(dllimport) #define PGF_API ERROR_NOT_COMPILING_LIBPGF