Compartir a través de


NDIS_RELEASE_MUTEX (Compact 2013)

3/26/2014

This macro releases the specified mutex object.

Syntax

NDIS_RELEASE_MUTEX(_Mutex_)

Parameters

  • _Mutex_
    A pointer to an initialized NDIS_MUTEX-type mutex object. The caller initialized the mutex object in a prior call to the NDIS_INIT_MUTEX macro. NDIS_MUTEX is a wrapper for the KMUTEX type.

Return Value

NDIS_RELEASE_MUTEX returns a ULONG value. If the return value is zero, the mutex object was released and is in the signaled state. If NDIS_RELEASE MUTEX returns a nonzero value, the mutex is not in the signaled state.

Remarks

NDIS network drivers should use the NDIS_RELEASE_MUTEX macro to release a mutex.

Only the thread that is currently holding the mutex object can release it. Otherwise, a bugcheck occurs. A bugcheck also occurs if a driver attempts to release a mutex object that is in the signaled state.

To obtain the mutex, call the NDIS_WAIT_FOR_MUTEX macro. If a mutex is obtained recursively, the holding thread must call NDIS_RELEASE_MUTEX the same number of times that it obtained the mutex to set it back to the signaled state.

NDIS_RELEASE_MUTEX is an NDIS wrapper for the KeReleaseMutex routine.

Requirements

Header

ndis.h

See Also

Reference

NDIS Interrupt and Synchronization Macros
NDIS_INIT_MUTEX
NDIS_WAIT_FOR_MUTEX