[Overview][Types][Classes][Index] Reference for unit 'LazCollections' (#lazutils)

TLazThreadedQueue.PopItemTimeout

Pops an item off the queue with a timeout value.

Declaration

Source position: lazcollections.pas line 112

public function TLazThreadedQueue.PopItemTimeout(

  out AItem: T;

  Timeout: Cardinal

):TWaitResult;

Arguments

AItem

  

Item removed from the queue.

Timeout

  

Maximum number of ticks to wait for the item to be removed from the queue.

Function result

Contains the status for the dequeue request.

Description

PopItemTimeout is a TWaitResult function used to remove the next available item in the queue with a timeout in effect for the dequeue operation.

AItem is an output parameter used to return the item removed from the thread-safe queue.

Timeout specifies the number of ticks (milliseconds) to wait for successful completion of the dequeue request. When Timeout contains the value INFINITE, a timeout is not used in the method. Instead, an internal RTL event is signalled to wait for an available item in the queue. When Timeout contains 0, the request returns immediately after the first failed attempt to dequeue an item.

When ShutDown contains True, the method updates the return value to indicate that the request was abandoned.

The return value contains a TWaitResult enumeration value that indicates the status for the dequeue request. See TWaitResult for more information about enumeration values and their meanings.

See also

TLazThreadedQueue.PopItem

  

Pops the next item from the queue.

TLazThreadedQueue.ShutDown

  

Indicates if the DoShutdown method has been called but not finished.

TWaitResult


Version 4.0 Generated 2025-05-03 Home