Prevent threads locking on filechange/shutdown