From f8319ebede962a9c89e192ab0496ba67fe2e4575 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Tue, 28 May 2013 16:52:10 +0300 Subject: [PATCH] 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 --- server/src/com/vaadin/server/VaadinSession.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 { -- 2.39.5