@Override public Future<?> submitBackgroundOperation(Runnable work) { return getSessionManager().submitBackgroundOperation( operationLock == null ? work : new FutureTask<Void>(work, null) { protected void done() { // We assume this always comes from a user operation that took the lock. operationLock.release(); }; }); }
CyclicBarrier completed = new CyclicBarrier(3); try { sm.submitBackgroundOperation(new BarrierRunnable(ready, completed)); sm.submitBackgroundOperation(new BarrierRunnable(ready, completed)); sm.submitBackgroundOperation(new BarrierRunnable(ready, completed)); sm.submitBackgroundOperation(new BarrierRunnable(ready, completed));
@Override public Future<?> submitBackgroundOperation(Runnable work) { return getSessionManager().submitBackgroundOperation( operationLock == null ? work : new FutureTask<Void>(work, null) { protected void done() { // We assume this always comes from a user operation that took the lock. operationLock.release(); }; }); }
getParentSession().getSessionManager().submitBackgroundOperation(backgroundOperation); setBackgroundHandle(backgroundHandle); } catch (RejectedExecutionException rejected) {
getParentSession().getSessionManager().submitBackgroundOperation(backgroundOperation); setBackgroundHandle(backgroundHandle); } catch (RejectedExecutionException rejected) {
getParentSession().getSessionManager().submitBackgroundOperation(backgroundOperation); setBackgroundHandle(backgroundHandle); } catch (RejectedExecutionException rejected) {
getParentSession().getSessionManager().submitBackgroundOperation(backgroundOperation); setBackgroundHandle(backgroundHandle); } catch (RejectedExecutionException rejected) {