func workerPool(numWorkers int, jobs <-chan int, results chan<- int) {
for i := 0; i < numWorkers; i++ {
class CASCounter {
private Unsafe unsafe;
private volatile long counter = 0;
private long offset;
private Unsafe getUnsafe() throws IllegalAccessException, NoSuchFieldException {
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
Callable<String> task1 = ...
Callable<Integer> task2 = ...
NewerOlder