You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What are your general thoughts on the ways to accomplish the task? How about providing your library all the mutexes of all extra threads, so tryReload event locks on all of them before proceeding?
Not sure about this approach, only as a dirty hack. Strictly speaking, you should avoid any threads from executing code at all, so even if you wait on locked mutex, there's a possibility of SIG_ILL during code reload. It is much smaller but it still exists.
More general one involves some external tools like ptrace or signals or smth else. I didn't investigate it deeper, but there's no api on linux similar to SuspendThread on Windows, so we cannot suspend thread of current process from within this process. Probably the general solution leads to launch the application from inside a "manager" process which also runs all code-reload-related tasks.
That's my general thoughts.
Talking about "hacky" version, you can try to pause your threads (lock your mutexes) inside ILiveListener::onCodePreLoad() function and resume (unlock) in ILiveListener::onCodePostLoad(). I've never tried this for such scenario, but I guess it should work most of the times.
No description provided.
The text was updated successfully, but these errors were encountered: