diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2021-05-01 22:04:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-01 22:04:29 +0100 |
commit | 81c796ece892dc94f8ce1928068b7b99fbba5190 (patch) | |
tree | f6997c6849add92053bb20363e5581d88bf226a9 /src | |
parent | 62001d116a35c1ccd70e177697439ec8fcfdc91c (diff) |
Make nLastError thread-local
Before this fix, `Get/SetLastError` on non-Windows behaved incorrectly when used from multiple threads.
Diffstat (limited to 'src')
-rw-r--r-- | src/FileStream.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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()
{
|