package edu.nyu.cs9053.concurrency.chapter14.threadcaching;

import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * User: blangel
 * Date: 7/26/14
 * Time: 11:35 AM
 */
public class ThreadValueCache {

    private final ConcurrentLinkedQueue<Long> queue;

    private long value;

    public ThreadValueCache(ConcurrentLinkedQueue<Long> queue) {
        this.queue = queue;
    }

    public void enqueue() {
        queue.offer(value);
    }

    public void increment() {
        value += 1L;
    }

}
