Create new Synchronous Queue - Java java.util

Java examples for java.util:Collection Creation

Description

Create new Synchronous Queue

Demo Code


//package com.java2s;

import java.util.concurrent.SynchronousQueue;

public class Main {
    public static void main(String[] argv) {
        System.out.println(newSynchronousQueue());
    }// ww w  .  j  a  va 2  s .c  o  m

    public static <E> SynchronousQueue<E> newSynchronousQueue() {
        return new SynchronousQueue<E>();
    }

    public static <E> SynchronousQueue<E> newSynchronousQueue(
            final boolean fair) {
        return new SynchronousQueue<E>(fair);
    }
}

Related Tutorials