The InitializeCriticalSection function initializes a critical section object.
VOID InitializeCriticalSection(
LPCRITICAL_SECTION lpCriticalSection |
// address of critical section object |
); |
This function does not return a value.
The threads of a single process can use a critical section object for mutual-exclusion synchronization. The process is responsible for allocating 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 the InitializeCriticalSection or InitializeCriticalSectionAndSpinCount function to initialize the object.
Once a critical section object has been initialized, the threads of the process can specify the object in the EnterCriticalSection, TryEnterCriticalSection, or LeaveCriticalSection function 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 also not modify the object, but must treat it as logically opaque. Use only the functions provided in the Win32 application programming interface (API) to manage critical section objects.
CreateMutex, DeleteCriticalSection, EnterCriticalSection, InitializeCriticalSectionAndSpinCount, LeaveCriticalSection, TryEnterCriticalSection
file: /Techref/os/win/api/win32/func/src/f49_6.htm, NaNKB (1 imgs) in 0.088s is NaNKBps, updated: 2002/11/1 19:04, local time: 2025/4/23 02:28,
13.58.115.236:LOG IN
|
©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://linistepper.com/techref/os/win/api/win32/func/src/f49_6.htm"> InitializeCriticalSection</A> |
Did you find what you needed? |