INtime SDK Help
InitializeCriticalSection (iwin32)
INtime SDK v7.1 > About INtime > Alternate APIs > iwin32 API > iwin32 API > InitializeCriticalSection (iwin32)

Creates a critical section, which is the same as a nameless mutex.

VOID InitializeCriticalSection(
    LPCRITICAL_SECTION  lpCriticalSection
);

Parameters

lpCriticalSection
Pointer to the critical section object

Remarks

The threads of a single process can use a critical section object for mutual-exclusion synchronization.

The process allocates the memory used by a critical section object, which it can do 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.

After a critical section object is initialized, process threads can specify the object in EnterCriticalSection or LeaveCriticalSection to provide mutually exclusive access to a shared resource. For similar synchronization between the threads of different processes, use a mutex object.

A critical section object cannot be moved or copied. The process must not modify the object, but treat it as logically opaque. To manage critical section objects, use only the critical section functions provided by the iwin32API.

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, LeaveCriticalSection, iwin32 API, iwin32 Overview