Fix freeze-crash in lightmapper under MinGW-GCC

This commit is contained in:
Pedro J. Estébanez 2021-01-21 11:59:04 +01:00
parent c97837d0ee
commit 3c4b607faf
4 changed files with 12 additions and 8 deletions

View file

@ -432,7 +432,7 @@ namespace embree
_mm_pause(); _mm_pause();
// -- GODOT start -- // -- GODOT start --
#else #else
usleep(1); __builtin_ia32_pause();
#endif #endif
// -- GODOT end -- // -- GODOT end --
} }

View file

@ -54,7 +54,8 @@ namespace embree
_mm_pause(); _mm_pause();
// -- GODOT start -- // -- GODOT start --
#else #else
usleep(1); __builtin_ia32_pause();
__builtin_ia32_pause();
#endif #endif
// -- GODOT end -- // -- GODOT end --
} }
@ -89,7 +90,8 @@ namespace embree
_mm_pause(); _mm_pause();
// -- GODOT start -- // -- GODOT start --
#else #else
usleep(1); __builtin_ia32_pause();
__builtin_ia32_pause();
#endif #endif
// -- GODOT end -- // -- GODOT end --
} }

View file

@ -367,7 +367,7 @@ namespace embree
_mm_pause(); _mm_pause();
// -- GODOT start -- // -- GODOT start --
#else #else
usleep(1); __builtin_ia32_pause();
#endif #endif
// -- GODOT end -- // -- GODOT end --
loopIndex++; loopIndex++;

View file

@ -90,7 +90,7 @@ diff --git a/common/sys/mutex.h b/common/sys/mutex.h
index 1164210f2..f0f55340a 100644 index 1164210f2..f0f55340a 100644
--- a/common/sys/mutex.h --- a/common/sys/mutex.h
+++ b/common/sys/mutex.h +++ b/common/sys/mutex.h
@@ -47,8 +47,16 @@ namespace embree @@ -47,8 +47,17 @@ namespace embree
{ {
while (flag.load()) while (flag.load())
{ {
@ -101,13 +101,14 @@ index 1164210f2..f0f55340a 100644
_mm_pause(); _mm_pause();
+// -- GODOT start -- +// -- GODOT start --
+#else +#else
+ usleep(1); + __builtin_ia32_pause();
+ __builtin_ia32_pause();
+#endif +#endif
+// -- GODOT end -- +// -- GODOT end --
} }
bool expected = false; bool expected = false;
@@ -74,8 +82,16 @@ namespace embree @@ -74,8 +82,17 @@ namespace embree
{ {
while(flag.load()) while(flag.load())
{ {
@ -118,7 +119,8 @@ index 1164210f2..f0f55340a 100644
_mm_pause(); _mm_pause();
+// -- GODOT start -- +// -- GODOT start --
+#else +#else
+ usleep(1); + __builtin_ia32_pause();
+ __builtin_ia32_pause();
+#endif +#endif
+// -- GODOT end -- +// -- GODOT end --
} }