INtime SDK Help
LeaveCriticalSection (iwin32)
INtime SDK v7 > About INtime > Alternate APIs > iwin32 API > iwin32 API > LeaveCriticalSection (iwin32)

Releases ownership of the specified critical section object.

VOID LeaveCriticalSection(
    LPCRITICAL_SECTION lpCriticalSection
);

Parameters

lpCriticalSection
Pointer to the critical section object.

Remarks

You cannot call this function from a pure INtime thread.

Threads of a single process can use a critical-section object for mutual-exclusion synchronization. The process allocates memory used by a critical-section object by declaring a variable of type CRITICAL_SECTION. Before using a critical section, some thread of the process must call InitializeCriticalSection to initialize the object.

A thread uses EnterCriticalSection to acquire ownership of a critical section object. To release its ownership, the thread must call LeaveCriticalSection once for each time it entered the critical section.

If a thread calls LeaveCriticalSection when it does not have ownership of the specified critical section object, an error occurs that may cause another thread using EnterCriticalSection to wait indefinitely.

Any thread of the process can use the DeleteCriticalSection function to release the system resources allocated when the critical section object was initialized. After this function is called, the critical section object can no longer be used for synchronization.

Return Values

None.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/winbase.h windows.h iwin32.lib

Note

This function operates in the real-time portion of your application.

See Also

DeleteCriticalSection, EnterCriticalSection, InitializeCriticalSection, ReleaseMutex, iwin32 API, iwin32 Overview