]> source.dussan.org Git - vaadin-framework.git/commitdiff
Avoid deadlock checking in runPendingAccessTasks() (#11897)
authorLeif Åstrand <leif@vaadin.com>
Tue, 28 May 2013 13:52:10 +0000 (16:52 +0300)
committerVaadin Code Review <review@vaadin.com>
Tue, 28 May 2013 15:56:47 +0000 (15:56 +0000)
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

index 9939ad709e18591d5f8365c2ae6b09cbd1d11029..551031b9474afd74295164dfcb9495ab0d85dcb9 100644 (file)
@@ -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 {