生产者消费者代码import java.util.concurrent.*;import java.util.concurrent.locks.*;public class ConsumerProducer private static Buffer buffer = new Buffer(); public static void main(String args) / Create a thread pool with two threads ExecutorService executor = Executors.newFixedThreadPool(2); executor.execute(new ProducerTask(); executor.execute(new ConsumerTask(); executor.shutdown(); / A task for adding an int to the buffer private stat