InitializeConditionVariable function (Windows)

Switch View :
ScriptFree
InitializeConditionVariable function

Applies to: desktop apps | Metro style apps

Initializes a condition variable.

Syntax

VOID WINAPI InitializeConditionVariable(
  __out  PCONDITION_VARIABLE ConditionVariable
);

Parameters

ConditionVariable [out]

A pointer to the condition variable.

Return value

This function does not return a value.

Remarks

Threads can atomically release a lock and enter the sleeping state using the SleepConditionVariableCS or SleepConditionVariableSRW function. The threads are woken using the WakeConditionVariable or WakeAllConditionVariable function.

Condition variables are user-mode objects that cannot be shared across processes.

Examples

For an example that uses this function, see Using Condition Variables.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Condition Variables
Synchronization Functions

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Community Content

a_sanya
can't debug

I cannot debug any application which contains InitializeConditionVariable() api call. Trying to start the debugger on a very simple console application, the application seems to start, but exits immediately without executing anything from main. Of course, the code is compiled without errors and warnings.

XP SP3, Visual C++ Express 2010


a_sanya
can't debug
<p>I cannot debug any application which contains InitializeConditionVariable() api call. Trying to start the debugger on a very simple console application, the application seems to start, but exits immediately without executing anything from main. Of course, the code is compiled without errors and warnings.</p><p>XP SP3, Visual C++ Express 2010</p>