I agree with Robert, any method of the QueueTaskDispatcher must return quickly because they are called while synchronized on the Jenkins Queue object so you can end up freezing Jenkins.

First, it looks like all the synchronize in this class is to protect concurrent access to the set so you could remove all of them and replace the set by a concurrent hash set. I know, Java only have a ConcurrentHashMap so her is the trick to create a set backed by a ConcurrentHashMap:

Set<GerritTriggeredEvent> currentlyTriggeringEvents = Collections.newSetFromMap(new ConcurrentHashMap<GerritTriggeredEvent, Boolean>());