|
|
@@ -1655,6 +1655,23 @@ public abstract class VaadinService implements Serializable { |
|
|
|
FutureAccess future = new FutureAccess(session, runnable); |
|
|
|
session.getPendingAccessQueue().add(future); |
|
|
|
|
|
|
|
ensureAccessQueuePurged(session); |
|
|
|
|
|
|
|
return future; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Makes sure the pending access queue is purged for the provided session. |
|
|
|
* If the session is currently locked by the current thread or some other |
|
|
|
* thread, the queue will be purged when the session is unlocked. If the |
|
|
|
* lock is not held by any thread, it is acquired and the queue is purged |
|
|
|
* right away. |
|
|
|
* |
|
|
|
* @since 7.1.2 |
|
|
|
* @param session |
|
|
|
* the session for which the access queue should be purged |
|
|
|
*/ |
|
|
|
public void ensureAccessQueuePurged(VaadinSession session) { |
|
|
|
/* |
|
|
|
* If no thread is currently holding the lock, pending changes for UIs |
|
|
|
* with automatic push would not be processed and pushed until the next |
|
|
@@ -1677,8 +1694,6 @@ public abstract class VaadinService implements Serializable { |
|
|
|
} catch (InterruptedException e) { |
|
|
|
// Just ignore |
|
|
|
} |
|
|
|
|
|
|
|
return future; |
|
|
|
} |
|
|
|
|
|
|
|
/** |