How to get async callbacks on an exited pthread? #16206
-
I have a pthread that has to call an async function via EM_JS. I cannot use Asyncify for a certain reason, so I thought my thread will simply finish executing after calling the async JS function, and in the But after a while the ccalled C++ code always crashes with runtime errors, out of bounds etc. I have found that I should be able to keep the runtime alive via one of three ways:
No matter which one I try, any substantial code that is called by my callback still crashes. Am I on the right track at all? I am suspicious because I think Emscripten reuses workers in the pool when the code creates new threads. How to use the above methods and do they automatically prevent the worker from being reused for another thread? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Eventually I managed to make |
Beta Was this translation helpful? Give feedback.
Eventually I managed to make
runtimeKeepalivePush
work. The crashes were caused by other code.