| 308 | } |
| 309 | |
| 310 | function reentryMutexLock(name) { |
| 311 | globalThis.nethackGlobal = globalThis.nethackGlobal || {}; |
| 312 | if(globalThis.nethackGlobal.shimFunctionRunning) { |
| 313 | console.error(`'${name}' attempting second call to 'local_callback' before '${globalThis.nethackGlobal.shimFunctionRunning}' has finished, will crash emscripten Asyncify. For details see: emscripten.org/docs/porting/asyncify.html#reentrancy`); |
| 314 | } |
| 315 | globalThis.nethackGlobal.shimFunctionRunning = name; |
| 316 | } |
| 317 | |
| 318 | function reentryMutexUnlock() { |
| 319 | globalThis.nethackGlobal.shimFunctionRunning = null; |