1
0
forked from GitHub/gf-core

fix the read/write lock on Windows

This commit is contained in:
Krasimir Angelov
2023-01-26 19:30:24 +01:00
parent dc2a3cb3d4
commit d32ba0538d
2 changed files with 3 additions and 3 deletions

View File

@@ -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 {

View File

@@ -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