Java Thread Lock createConcurrentStack()

Here you can find the source of createConcurrentStack()

Description

create Concurrent Stack

License

Apache License

Declaration

public static <E> Queue<E> createConcurrentStack() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collections;
import java.util.Deque;

import java.util.Queue;

public class Main {

    public static <E> Queue<E> createConcurrentStack() {
        return (Queue<E>) Collections.asLifoQueue(newConcurrentNonBlockingDeque());
    }/*from   w w  w. j  a va2s.  com*/

    public static <E> Deque<E> newConcurrentNonBlockingDeque() {
        return new java.util.concurrent.ConcurrentLinkedDeque<E>();
    }
}

Related

  1. canCreateNewThread()
  2. downgradeWriteLock(final ReadWriteLock lock)
  3. fillReadWriteLocks(List readLocks, List writeLocks, int curSize, int size)
  4. getAllMessages()
  5. getGradingReadLock()