deleteCriticalSection
Syntax
- bool deleteCriticalSection(int hCS)
Arguments
- hCS
- Specifies the handle of the Critical Section to be deleted, as obtained from a call to createCriticalSection.
Return
- This function returns true immediately after deleting the specified Critical Section. It returns false if hCS is zero.
Description
- This function deletes a specified Critical Section and releases all system resources that were allocated to it. Any thread can delete the Critical Section, but it must be currently unowned by any thread. After a Critical Section is deleted, it can no longer be used as a synchronization object until it is recreated by a call to createCriticalSection.
- For more information about Critical Sections, see the MSDN documentation about [Critical Section Objects].
Example
- See the createCriticalSection example.
Also see
- System Functions, Critical Section Functions, createCriticalSection, enterCriticalSection, tryEnterCriticalSection, leaveCriticalSection
Comments
Everyone can add his or her comments about his or her experiences with this function. Tips for using it are welcome, too.
- One need not normally test the return value of deleteCriticalSection. This is merely a check to make sure that hCS is non-zero so the DeleteCriticalSection Win32 API won't cause a memory access violation.