Export (0) Print
Expand All

concurrent_queue::try_pop Method

Dequeues an item from the queue if one is available. This method is concurrency-safe.

bool try_pop(
   _Ty& _Dest
);

_Dest

A reference to a location to store the dequeued item.

true if an item was successfully dequeued,false otherwise.

If an item was successfully dequeued, the parameter _Dest receives the dequeued value, the original value held in the queue is destroyed, and this function returns true. If there was no item to dequeue, this function returns false without blocking, and the contents of the _Dest parameter are undefined.

try_pop is concurrency-safe with respect to calls to the methods push, try_pop, and empty.

Header: concurrent_queue.h

Namespace: concurrency

Show:
© 2014 Microsoft