1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>OS_WaitVBlankIntr</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">OS_WaitVBlankIntr <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <nitro/os.h></CODE></PRE> 16 <PRE><CODE>void OS_WaitVBlankIntr( void );</CODE></PRE> 17</DL> 18<H2>Arguments</H2> 19<P>None.</P> 20<H2>Return Values</H2> 21<P>None.</P> 22<H2>Description</H2> 23<P>Waits until a V-Blank interrupt is generated. This is different from <CODE><A href="../../svc/SVC_WaitVBlankIntr.html">SVC_WaitVBlankIntr()</A></CODE>, since when there is open time, the CPU <FONT color="#ff0000">switches to other threads.</FONT></P> 24<P>Set the V-Blank check flag with <code><A href="../irq/OS_SetIrqCheckFlag.html">OS_SetIrqCheckFlag</a>( OS_IE_V_BLANK )</code> in the V-Blank interrupt handler. <code>OS_WaitVBlankIntr()</code> checks whether this flag has be set after IRQ interrupt and whether V-Blank has already occurred.</P> 25<H3><BR> <BR> When Multiple Threads Have the Same V-Blank Interrupt</H3> 26<P>It's important to be careful when multiple threads call <CODE>OS_WaitVBlankIntr()</CODE> at the same time. The reason is that in <CODE>OS_WaitVBlankIntr()</CODE>, the first V-Blank's checkflag is cleared. For example, when two threads are waiting for V-Blank with <CODE>OS_WaitVBlankIntr()</CODE>, the first thread returned performs a certain operation. Then, when <CODE>OS_WaitVBlankIntr()</CODE> is encountered again, the flag is already cleared, so the other thread cannot be returned.</P> 27<H2>See Also</H2> 28<P><CODE><A href="../../svc/SVC_WaitVBlankIntr.html">SVC_WaitVBlankIntr</A><BR></CODE></P> 29<H2>Revision History</H2> 30<P>2005/10/07 Initial version.</P> 31<hr><p>CONFIDENTIAL</p></body> 32</HTML>