Export (0) Print
Expand All
Expand Minimize

DeleteCriticalSection function

Releases all resources used by an unowned critical section object.

Syntax


void WINAPI DeleteCriticalSection(
  _Inout_  LPCRITICAL_SECTION lpCriticalSection
);

Parameters

lpCriticalSection [in, out]

A pointer to the critical section object. The object must have been previously initialized with the InitializeCriticalSection function.

Return value

This function does not return a value.

Remarks

Deleting a critical section object releases all system resources used by the object.

After a critical section object has been deleted, do not reference the object in any function that operates on critical sections (such as EnterCriticalSection, TryEnterCriticalSection, and LeaveCriticalSection) other than InitializeCriticalSection and InitializeCriticalSectionAndSpinCount. If you attempt to do so, memory corruption and other unexpected errors can occur.

If a critical section is deleted while it is still owned, the state of the threads waiting for ownership of the deleted critical section is undefined.

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Examples

For an example that uses DeleteCriticalSection, see Using Critical Section Objects.

Requirements

Minimum supported client

Windows XP [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2003 [desktop apps | Windows Store apps]

Header

WinBase.h on Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008, and Windows Server 2008 R2 (include Windows.h);
Synchapi.h on Windows 8 and Windows Server 2012

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Critical Section Objects
EnterCriticalSection
InitializeCriticalSection
LeaveCriticalSection
Synchronization Functions
TryEnterCriticalSection

 

 

Community Additions

ADD
Show:
© 2014 Microsoft