|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| Yes
| Win32s
| Yes
| Import Library
| kernel32.lib
| Header File
| winbase.h
| Unicode
| No
| Platform Notes
| None
|
|
|
InitializeCriticalSection
The InitializeCriticalSection function initializes a critical section object.
VOID InitializeCriticalSection(
LPCRITICAL_SECTION lpCriticalSection
| // address of critical section object
| );
|
|
Parameters
lpCriticalSection
Points to the critical section object.
Return Values
This function does not return a value.
Remarks
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 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.
See Also
CreateMutex, DeleteCriticalSection, EnterCriticalSection, LeaveCriticalSection, TryEnterCriticalSection
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
More Online Helps
Win32 Programmer's Reference (win32.hlp)
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|