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
if (!pendingAccess.isCancelled()) {
CurrentInstance.clearAll();
CurrentInstance.restoreInstances(pendingAccess.instances);
- accessSynchronously(pendingAccess);
+ CurrentInstance.setCurrent(this);
+ pendingAccess.run();
}
}
} finally {