Skip to content

Commit

Permalink
set _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
surepy committed Aug 30, 2024
1 parent ef92fb0 commit 07105ff
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tf2_bot_detector/BatchedAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
#include "Clock.h"
#include "Log.h"

#ifdef _WIN32
// https://developercommunity.visualstudio.com/t/Access-violation-in-_Thrd_yield-after-up/10664660
// https://stackoverflow.com/questions/44998460/c-stdmutex-lock-access-violation-in-visual-studio-2017
// thank you mr microsoft
#define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
#endif

#include <mutex>
#include <unordered_set>

Expand Down
7 changes: 7 additions & 0 deletions tf2_bot_detector/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
#include <mh/text/stringops.hpp>
#include <SDL2/SDL_messagebox.h>

#ifdef _WIN32
// https://developercommunity.visualstudio.com/t/Access-violation-in-_Thrd_yield-after-up/10664660
// https://stackoverflow.com/questions/44998460/c-stdmutex-lock-access-violation-in-visual-studio-2017
// thank you mr microsoft
#define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
#endif

#include <atomic>
#include <deque>
#include <filesystem>
Expand Down
7 changes: 7 additions & 0 deletions tf2_bot_detector/Platform/Windows/CrashHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#ifdef _WIN32

#ifdef _WIN32
// https://developercommunity.visualstudio.com/t/Access-violation-in-_Thrd_yield-after-up/10664660
// https://stackoverflow.com/questions/44998460/c-stdmutex-lock-access-violation-in-visual-studio-2017
// thank you mr microsoft
#define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
#endif

#include <ctime>
#include <mutex>
#include <thread>
Expand Down
7 changes: 7 additions & 0 deletions tf2_bot_detector/Platform/Windows/Processes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
#include <mh/text/insertion_conversion.hpp>
#include <mh/text/string_insertion.hpp>

#ifdef _WIN32
// https://developercommunity.visualstudio.com/t/Access-violation-in-_Thrd_yield-after-up/10664660
// https://stackoverflow.com/questions/44998460/c-stdmutex-lock-access-violation-in-visual-studio-2017
// thank you mr microsoft
#define _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
#endif

#include <atomic>
#include <cassert>
#include <chrono>
Expand Down

0 comments on commit 07105ff

Please sign in to comment.