/** Clean up the thread locals in the current thread */ public void cleanup() { for (ThreadLocalTransfer transfer : transfers) { transfer.cleanup(); } } }
@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; }