ExInterlockedPopEntryList function

The ExInterlockedPopEntryList routine atomically removes an entry from the beginning of a singly linked list of SINGLE_LIST_ENTRY structures.

Syntax

PSINGLE_LIST_ENTRY ExInterlockedPopEntryList(
  _Inout_ PSINGLE_LIST_ENTRY ListHead,
  _Inout_ PKSPIN_LOCK        Lock
);

Parameters

ListHead

A pointer to the SINGLE_LIST_ENTRY structure that serves as the list header.

Lock

A pointer to a KSPIN_LOCK structure that serves as the spin lock used to synchronize access to the list. The storage for the spin lock must be resident and must have been initialized by calling KeInitializeSpinLock. You must use this spin lock only with the ExInterlockedXxxList routines.

Return Value

ExInterlockedPopEntryList returns a pointer to the SINGLE_LIST_ENTRY structure removed from the list. If the list was empty, the routine returns NULL.

Remarks

ExInterlockedPopEntryList performs the same operation as PopEntryList, but atomically. Do not mix atomic and non-atomic calls on the same list.

For more information about using this routine to implement a singly linked list, see Singly and Doubly Linked Lists.

The ExInterlockedPopEntryList routine can be called at any IRQL. The storage for the ListHead parameter must be resident at all IRQLs.

Requirements

   
Windows version Available starting with Windows 2000. Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL Any level (see Remarks section)

See Also

KeInitializeSpinLock

ExInterlockedPopEntrySList

ExInitializeSListHead

PopEntryList

ExInterlockedPushEntryList

Send comments about this topic to Microsoft