Skip to content

Instantly share code, notes, and snippets.

@chrisvest
Created January 7, 2017 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvest/01210093e0aac943108985cbb74eb1fd to your computer and use it in GitHub Desktop.
Save chrisvest/01210093e0aac943108985cbb74eb1fd to your computer and use it in GitHub Desktop.
void popAll( Consumer<Object> consumer ) {
Node nodes = stack.getAndSet( END );
while ( nodes != END ) {
consumer.accept( nodes.value );
Node next;
do {
next = nodes.next;
} while ( next == null );
nodes = next;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment