Synchronization Functions


DeleteCriticalSection Function

Releases all resources used by an unowned critical section object.

Syntax

C++
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.

Examples

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

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

Critical Section Objects
EnterCriticalSection
InitializeCriticalSection
LeaveCriticalSection
Synchronization Functions
TryEnterCriticalSection

Send comments about this topic to Microsoft

Build date: 10/8/2009

Tags :


Page view tracker