/** Set the thread local values in the current thread */ public void apply() { for (ThreadLocalTransfer transfer : transfers) { transfer.apply(storage); } }
@Override public Void call() throws Exception { // this is the the main thread, we are actually running inside the thread pool assertNotEquals(originalThread, Thread.currentThread()); // apply the thread local, check it has been applied correctly transfer.apply(storage); assertThreadLocalApplied(); // clean up, check the therad local is now empty transfer.cleanup(); assertThreadLocalCleaned(); return null; }
@Override public Void call() throws Exception { // this is the the main thread, we are actually running inside the thread pool assertNotEquals(originalThread, Thread.currentThread()); // apply the thread local, check it has been applied correctly transfer.apply(storage); assertThreadLocalApplied(); // clean up, check the therad local is now empty transfer.cleanup(); assertThreadLocalCleaned(); return null; }