@Test public void threadLocal() { AutoreleaseBatcher.forThread(1); ID idNSObject = Foundation.cfRetain(autoreleasedObject()); assertRetainCount(2, idNSObject); AutoreleaseBatcher.forThread(1).operate(); assertRetainCount(1, idNSObject); }
public static AutoreleaseBatcher forThread(int batchSize) { if (threadLocal.get() == null) { threadLocal.set(new AutoreleaseBatcher(batchSize)); } return threadLocal.get(); }
AutoreleaseBatcher extends OperationBatcher { public static AutoreleaseBatcher forThread(int batchSize) { if (threadLocal.get() == null) { threadLocal.set(new AutoreleaseBatcher(batchSize)); } return threadLocal.get(); } }
AutoreleaseBatcher extends OperationBatcher { public static AutoreleaseBatcher forThread(int batchSize) { if (threadLocal.get() == null) { threadLocal.set(new AutoreleaseBatcher(batchSize)); } return threadLocal.get(); } AutoreleaseBatcher(int batchSize); }
AutoreleaseBatcher extends OperationBatcher { public static AutoreleaseBatcher forThread(int batchSize) { if (threadLocal.get() == null) { threadLocal.set(new AutoreleaseBatcher(batchSize)); } return threadLocal.get(); } AutoreleaseBatcher(int batchSize); static AutoreleaseBatcher forThread(int batchSize); }
AutoreleaseBatcher extends OperationBatcher { public static AutoreleaseBatcher forThread(int batchSize) { if (threadLocal.get() == null) { threadLocal.set(new AutoreleaseBatcher(batchSize)); } return threadLocal.get(); } AutoreleaseBatcher(int batchSize); static AutoreleaseBatcher forThread(int batchSize);  }