I'm having some trouble with a long running action (in my case, it is a project resynchronisation of VCS)
Currently, I'm starting it with runReadAction() in a helper thread and displaying a (custom) progress dialog. As the UI Thread is not blocked that way, one can nicely watch the progress. However, if one switches to another Task and back, the UI Thread gets blocked with a write-action which is waiting on my long-lasting-read-action to finish (I suspect the culprit in the file-resync-on-frame-activation). Even worse, on certain circumstances another dialog has to be displayed during the progress. This leads to a deadlock, as the UI Thread is waiting on the secondary thread to finish and vice-versa.
Is there any way to prevent IDEA from executing new actions on the UI Thread while my Action is running? Any idea for another way to solve this problem?