From: Leif Åstrand Date: Tue, 28 May 2013 13:52:10 +0000 (+0300) Subject: Avoid deadlock checking in runPendingAccessTasks() (#11897) X-Git-Tag: 7.1.0~90^2~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f8319ebede962a9c89e192ab0496ba67fe2e4575;p=vaadin-framework.git Avoid deadlock checking in runPendingAccessTasks() (#11897) The deadlock check in accessSynchronously() was triggered in cases where one session was locked and tryLock() in access() did manage to lock another session and thus attempted to run the runnable right away. runPendingAccessTasks() needed accessSynchronously() just for setting up the current session instance - the session was already locked and cleaning up the CurrentInstance values afterwards was not needed. Just setting the current session without accessSynchronously() gets rid of the inappropriate deadlock detection as well as some overhead with managing locks and CurrentInstance values. Change-Id: Ib956d68884d6703dce2633a455c4857bb06651af --- diff --git a/server/src/com/vaadin/server/VaadinSession.java b/server/src/com/vaadin/server/VaadinSession.java index 9939ad709e..551031b947 100644 --- a/server/src/com/vaadin/server/VaadinSession.java +++ b/server/src/com/vaadin/server/VaadinSession.java @@ -1263,7 +1263,8 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { if (!pendingAccess.isCancelled()) { CurrentInstance.clearAll(); CurrentInstance.restoreInstances(pendingAccess.instances); - accessSynchronously(pendingAccess); + CurrentInstance.setCurrent(this); + pendingAccess.run(); } } } finally {