⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csdn_文档中心_win32多线程程序设计学习笔记(第四章 下 第五章).htm

📁 csdn10年中间经典帖子
💻 HTM
📖 第 1 页 / 共 5 页
字号:
                  style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT 
                  size=2>函数</FONT></SPAN></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 173.75pt; mso-border-left-alt: solid windowtext .5pt" 
                vAlign=top width=232>
                  <P align=center class=MsoNormal 
                  style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><FONT 
                  face=宋体><FONT size=2><SPAN lang=EN-US 
                  style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">[Manual</SPAN><SPAN 
                  style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方式产生</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">]</SPAN></FONT></FONT></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: windowtext 0.5pt solid; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 186.7pt; mso-border-left-alt: solid windowtext .5pt" 
                vAlign=top width=249>
                  <P align=center class=MsoNormal 
                  style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><FONT 
                  face=宋体><FONT size=2><SPAN lang=EN-US 
                  style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">[Auto</SPAN><SPAN 
                  style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">方式产生</SPAN><SPAN 
                  lang=EN-US 
style="COLOR: blue">]</SPAN></FONT></FONT></P></TD></TR>
              <TR>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 65.65pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=88>
                  <P align=center class=MsoNormal 
                  style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><SPAN 
                  lang=EN-US><FONT face=宋体 size=2>Wait…()</FONT></SPAN></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 173.75pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=232>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT 
                  size=2><SPAN 
                  style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当</SPAN><FONT 
                  face=宋体><SPAN lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象变为激发状态</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">(</SPAN><SPAN 
                  style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使得因调用</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">Wait…()</SPAN><SPAN 
                  style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">而等待的线程被唤醒</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">)</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之后,不会被重置为非激发状态</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">(</SPAN><SPAN 
                  style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">必须调用</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">ResetEvent())</SPAN><SPAN 
                  lang=EN-US 
                  style="COLOR: red"><o:p></o:p></SPAN></FONT></FONT></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 186.7pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=249>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT 
                  size=2><SPAN 
                  style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">当</SPAN><FONT 
                  face=宋体><SPAN lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象变为激发状态</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">(</SPAN><SPAN 
                  style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使得因调用</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">Wait…()</SPAN><SPAN 
                  style="COLOR: blue; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">而等待的线程被唤醒</SPAN><SPAN 
                  lang=EN-US style="COLOR: blue">)</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">之后,自动重置为非激发状态</SPAN><SPAN 
                  lang=EN-US 
                  style="COLOR: red"><o:p></o:p></SPAN></FONT></FONT></P></TD></TR>
              <TR>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 65.65pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=88>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
                  lang=EN-US><FONT face=宋体 
size=2>SetEvent()</FONT></SPAN></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 173.75pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=232>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT 
                  size=2><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把</SPAN><FONT 
                  face=宋体><SPAN lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象设为激发状态</SPAN></FONT></FONT></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 186.7pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=249>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT 
                  size=2><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把</SPAN><FONT 
                  face=宋体><SPAN lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象设为激发状态</SPAN></FONT></FONT></P></TD></TR>
              <TR>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 65.65pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=88>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
                  lang=EN-US><FONT face=宋体 
                size=2>ResetEvent()</FONT></SPAN></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 173.75pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=232>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT 
                  size=2><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把</SPAN><FONT 
                  face=宋体><SPAN lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象设为非激发状态</SPAN></FONT></FONT></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 186.7pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=249>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT 
                  size=2><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把</SPAN><FONT 
                  face=宋体><SPAN lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象设为非激发状态</SPAN></FONT></FONT></P></TD></TR>
              <TR>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 65.65pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=88>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
                  lang=EN-US><FONT face=宋体 
                size=2>PulseEvent()</FONT></SPAN></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 173.75pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=232>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT 
                  size=2><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把</SPAN><FONT 
                  face=宋体><SPAN lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象设为激发状态</SPAN><SPAN 
                  lang=EN-US>,</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">唤醒“所有”等待中的线程</SPAN><SPAN 
                  lang=EN-US>,</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">然后把</SPAN><SPAN 
                  lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象设为非激发状态</SPAN></FONT></FONT></P></TD>
                <TD 
                style="BACKGROUND-COLOR: transparent; BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: #d4d0c8; BORDER-RIGHT: windowtext 0.5pt solid; BORDER-TOP: #d4d0c8; PADDING-BOTTOM: 0cm; PADDING-LEFT: 5.4pt; PADDING-RIGHT: 5.4pt; PADDING-TOP: 0cm; WIDTH: 186.7pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" 
                vAlign=top width=249>
                  <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT 
                  size=2><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">把</SPAN><FONT 
                  face=宋体><SPAN lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象设为激发状态</SPAN><SPAN 
                  lang=EN-US>,</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">唤醒“一个”等待中的线程</SPAN><SPAN 
                  lang=EN-US>,</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">然后把</SPAN><SPAN 
                  lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
                  style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象设为非激发状态</SPAN></FONT></FONT></P></TD></TR></TBODY></TABLE>
            <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face=宋体><FONT 
            size=2><SPAN lang=EN-US style="COLOR: green">[</SPAN><SPAN 
            style="COLOR: green; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用</SPAN><SPAN 
            lang=EN-US style="COLOR: green">CreateEvent ()</SPAN><SPAN 
            style="COLOR: green; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"> </SPAN><SPAN 
            lang=EN-US style="COLOR: green">API</SPAN><SPAN 
            style="COLOR: green; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">函数构造</SPAN><SPAN 
            lang=EN-US style="COLOR: red">EVENT</SPAN><SPAN 
            style="COLOR: green; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">核心对象</SPAN><SPAN 
            style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">,</SPAN><SPAN 
            lang=EN-US style="COLOR: green">CreateEvent ()</SPAN><SPAN 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -