Skip to content

Commit 12a642f

Browse files
authored
Fix calls to std::mutex::lock (#14223)
* Fix calls to std::mutex::lock * Change files
1 parent 57a42b1 commit 12a642f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Fix calls to std::mutex::lock",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

vnext/PropertySheets/React.Cpp.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@
6666
<PreprocessorDefinitions Condition="'$(UseV8)'=='true'">USE_V8;%(PreprocessorDefinitions)</PreprocessorDefinitions>
6767
<PreprocessorDefinitions Condition="'$(UseFabric)'=='true'">USE_FABRIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
6868
<PreprocessorDefinitions>JSI_VERSION=11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
69+
<!--
70+
To address the crash on the first call to std::mutex::lock.
71+
See: https://github.com/microsoft/STL/wiki/Changelog#vs-2022-1710
72+
https://stackoverflow.com/questions/78598141/first-stdmutexlock-crashes-in-application-built-with-latest-visual-studio
73+
-->
74+
<PreprocessorDefinitions>_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
6975
</ClCompile>
7076
</ItemDefinitionGroup>
7177

0 commit comments

Comments
 (0)