We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11f1da0 commit 4a93640Copy full SHA for 4a93640
1 file changed
src/engine/engine_util_errmem.c
@@ -21,6 +21,12 @@
21
#include <string.h>
22
#include <time.h>
23
24
+#if defined(_WIN32)
25
+#include <windows.h>
26
+#elif defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__EMSCRIPTEN__)
27
+#include <sched.h>
28
+#endif
29
+
30
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
31
#include <unistd.h>
32
#endif
@@ -152,7 +158,11 @@ static const mjLogConfig* mju_getLogConfigPtr(void) {
152
158
} else {
153
159
// another thread is initializing; spin until it completes
154
160
while (!mj_atomic_load_bool(&env_init_done)) {
155
- // empty
161
162
+ Sleep(0);
163
164
+ sched_yield();
165
156
166
}
157
167
168
0 commit comments