public BDEQueue(int capacity) { tasks = new Task[capacity]; top = new AtomicStampedReference <int>(0, 0); bottom = 0; }