DDAudioQueue / Source / DDAtomicList.h

 *  DDAtomicList.h
 *  DDAudioQueue
 *  Created by Dave Dribin on 4/20/10.
 *  Copyright 2010 Bit Maki, Inc. All rights reserved.

#include <stdlib.h>

// lockless and thread safe linked list utilities
// a NULL list is considered empty
typedef void * DDAtomicListRef;

// thread safe functions: may be called on a shared list from multiple threads with no locking
void DDAtomicListInsert(DDAtomicListRef * listPtr, void * node, size_t linkOffset);
DDAtomicListRef DDAtomicListSteal(DDAtomicListRef * listPtr);

// thread unsafe functions: must be called only on lists which other threads cannot access
void DDAtomicListReverse(DDAtomicListRef * listPtr, size_t linkOffset);
void *DDAtomicListPop(DDAtomicListRef * listPtr, size_t linkOffset); // returns NULL on empty list

 * Based heavily on Mike Ash's RAAtomicList (included with RAOperatoinQueue),
 * but works a next pointer inside structures to avoid allocating and freeing
 * memory on insertion and pop.
 * http://www.rogueamoeba.com/utm/2008/12/01/raoperationqueue-an-open-source-replacement-for-nsoperationqueue/
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.