Skip to content

Latest commit

 

History

History
93 lines (73 loc) · 3.73 KB

nf-synchapi-deletecriticalsection.md

File metadata and controls

93 lines (73 loc) · 3.73 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:synchapi.DeleteCriticalSection
DeleteCriticalSection function (synchapi.h)
Releases all resources used by an unowned critical section object.
DeleteCriticalSection
DeleteCriticalSection function
_win32_deletecriticalsection
base.deletecriticalsection
synchapi/DeleteCriticalSection
winbase/DeleteCriticalSection
base\deletecriticalsection.htm
base
97e29fc3-b155-448e-aaa9-19f0fc2d841e
02/05/2024
DeleteCriticalSection, DeleteCriticalSection function, _win32_deletecriticalsection, base.deletecriticalsection, synchapi/DeleteCriticalSection, winbase/DeleteCriticalSection
synchapi.h
Windows.h on Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008 Windows Server 2008 R2
Windows
Windows XP [desktop apps \| UWP apps]
Windows Server 2003 [desktop apps \| UWP apps]
Kernel32.lib
Kernel32.dll
Windows
19H1
DeleteCriticalSection
synchapi/DeleteCriticalSection
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-Synch-l1-1-0.dll
KernelBase.dll
API-MS-Win-Core-Synch-l1-2-0.dll
API-MS-Win-Core-Synch-l1-2-1.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
vertdll.dll
DeleteCriticalSection

DeleteCriticalSection function

-description

Releases all resources used by an unowned critical section object.

-parameters

-param lpCriticalSection [in, out]

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

-remarks

Deleting a critical section object releases all system resources used by the object. The caller is responsible for ensuring that the critical section object is unowned and the specified CRITICAL_SECTION structure is not being accessed by any critical section functions called by other threads in the process.

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.

-see-also

Critical Section Objects

EnterCriticalSection

InitializeCriticalSection

LeaveCriticalSection

Synchronization Functions

TryEnterCriticalSection

Vertdll APIs available in VBS enclaves