APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.utils

public Class AtomicQueue<T>

extends Object
Class Inheritance
Imports
java.util.concurrent.atomic.AtomicInteger, .AtomicReferenceArray

A queue that allows one thread to call put(Object) and another thread to call poll(). Multiple threads must not call these methods.
Author
Matthias Mann

Field Summary

Modifier and TypeField and Description
private final AtomicReferenceArray<T>
private final AtomicInteger
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
public
AtomicQueue(int capacity)

Method Summary

Modifier and TypeMethod and Description
private int
next(int idx)

public T
poll()

public boolean
put(T value)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

queueback to summary
private final AtomicReferenceArray<T> queue
readIndexback to summary
private final AtomicInteger readIndex
writeIndexback to summary
private final AtomicInteger writeIndex

Constructor Detail

AtomicQueueback to summary
public AtomicQueue(int capacity)

Method Detail

nextback to summary
private int next(int idx)
pollback to summary
public T poll()
Annotations
@Null
putback to summary
public boolean put(T value)