diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2022-10-31 13:31:58 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2022-10-31 13:31:58 +0200 |
commit | e53e0e2186c6b8ce866bd19aec52f1c318ed31ba (patch) | |
tree | 2be915514ded594ca3f88403d3639c6cd2a427e1 /src | |
parent | liblzma: Silence -Wconversion warning from crc64_fast.c. (diff) | |
download | xz-e53e0e2186c6b8ce866bd19aec52f1c318ed31ba.tar.xz |
Windows: Fix mythread_once() macro with Vista threads.
Don't call InitOnceComplete() if initialization was already done.
So far mythread_once() has been needed only when building
with --enable-small. windows/build.bash does this together
with --disable-threads so the Vista-specific mythread_once()
is never needed by those builds. VS project files or
CMake-builds don't support HAVE_SMALL builds at all.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/mythread.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/mythread.h b/src/common/mythread.h index be226542..41382183 100644 --- a/src/common/mythread.h +++ b/src/common/mythread.h @@ -370,10 +370,11 @@ typedef struct { BOOL pending_; \ if (!InitOnceBeginInitialize(&once_, 0, &pending_, NULL)) \ abort(); \ - if (pending_) \ + if (pending_) { \ func(); \ - if (!InitOnceComplete(&once, 0, NULL)) \ - abort(); \ + if (!InitOnceComplete(&once, 0, NULL)) \ + abort(); \ + } \ } while (0) #endif |