Closed soulomoon closed 2 weeks ago
it's pretty much identical to having a resource that's guarded by a lock
yes, with a bit different, enqueued actions would not be cancelled even if the thread start it is cancelled.
It reminds me of something, we might probably want to limit some of the queue size to 1, so the waiting to enqueue action can be cancelled when we are doing shakeRestart. Then less likely a duplication actions would be run for the sessionLoadQueue But maybe in another PR, we might need to come up with some design, such as we might need a bit wrapping to do over TQueue and TMVar if we do it this way.
see #4251 What's done
Development.IDE.Core.Thread
to provide common api to run a woker threadrunWithDb
using theDevelopment.IDE.Core.Thread
Development.IDE.Core.Thread
The above modification ensure the shutdown handler can cancel the session loading and session restart. And hence we would have a more correct shutdown behaviour. Potentially make the test less likely to hang.