MFLockWorkQueue function (mfapi.h)

Locks a work queue.

Syntax

HRESULT MFLockWorkQueue(
  [in] DWORD dwWorkQueue
);

Parameters

[in] dwWorkQueue

The identifier for the work queue. The identifier is returned by the MFAllocateWorkQueue function.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This function prevents the MFShutdown function from shutting down the work queue. Use this function to ensure that asynchronous operations on the work queue complete gracefully before the platform shuts down. The MFShutdown function blocks until the work queue is unlocked, or until a fixed wait period has elapsed. (The wait period is a few seconds.)

Call MFUnlockWorkQueue to unlock the work queue. Each call to MFLockWorkQueue must be matched by a corresponding call to MFUnlockWorkQueue.

Note  The MFAllocateWorkQueue function implicitly locks the work queue that it creates.
 

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header mfapi.h
Library Mfplat.lib
DLL Mfplat.dll

See also

Media Foundation Functions

Work Queues