From 81c796ece892dc94f8ce1928068b7b99fbba5190 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 1 May 2021 22:04:29 +0100 Subject: Make nLastError thread-local Before this fix, `Get/SetLastError` on non-Windows behaved incorrectly when used from multiple threads. --- src/FileStream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/FileStream.cpp b/src/FileStream.cpp index 7268923..2266518 100644 --- a/src/FileStream.cpp +++ b/src/FileStream.cpp @@ -34,7 +34,7 @@ // Local functions - platform-specific functions #ifndef STORMLIB_WINDOWS -static DWORD nLastError = ERROR_SUCCESS; +static thread_local DWORD nLastError = ERROR_SUCCESS; DWORD GetLastError() { -- cgit v1.2.3