<commit_before>package zab.atomics.pool;

import java.util.concurrent.atomic.AtomicReference;

/**
 * An atomic pool of objects.  It is based on an inverted list.
 * 
 * The pool has no maximum capacity and starts off empty.  You need to load it
 * with objects you want pooled by calling the "release" method.
 * 
 * @author zlatinb
 *
 * @param <T> type of the objects in the pool
 */
public class AtomicPool<T> {
<commit_msg>document that it's a freelist<commit_after>package zab.atomics.pool;

import java.util.concurrent.atomic.AtomicReference;

/**
 * An atomic pool of objects.  It is based on an freelist.
 * 
 * The pool has no maximum capacity and starts off empty.  You need to load it
 * with objects you want pooled by calling the "release" method.
 * 
 * COSTS: acquire and release cost at least one CAS instruction.
 * 
 * @author zlatinb
 *
 * @param <T> type of the objects in the pool
 */
public class AtomicPool<T> {

{'fraction_non_alphanumeric': 0.08440170940170941, 'fraction_numerical': 0.0, 'mean_word_length': 3.5485436893203883, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3613043', 'n_tokens_mistral': 291, 'n_tokens_neox': 275, 'n_words': 123}