WaitForSingleObject

Waits until the specified object is in the signaled state or the time-out interval elapses.

DWORD WINAPI WaitForSingleObject(
_In_ HANDLE hHandle,
_In_ DWORD dwMilliseconds
);

Remarks

The WaitForSingleObject function checks the current state of the specified object. If the object's state is nonsignaled, the calling thread enters the wait state until the object is signaled or the time-out interval elapses.

The function modifies the state of some types of synchronization objects. Modification occurs only for the object whose signaled state caused the function to return. For example, the count of a semaphore object is decreased by one.

The WaitForSingleObject function can wait for the following objects:

  • Change notification
  • Console input
  • Event
  • Memory resource notification
  • Mutex
  • Process
  • Semaphore
  • Thread
  • Waitable timer

CreateThread

Creates a thread to execute within the virtual address space of the calling process.

HANDLE WINAPI CreateThread(
_In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
_In_ SIZE_T dwStackSize,
_In_ LPTHREAD_START_ROUTINE lpStartAddress,
_In_opt_ LPVOID lpParameter,
_In_ DWORD dwCreationFlags,
_Out_opt_ LPDWORD lpThreadId
);

参考:

MSDN:https://msdn.microsoft.com/en-us/library/ms687032.aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682453%28v=vs.85%29.aspx

Windows API 之 CreateThread、WaitForSingleObject(未完)的更多相关文章

  1. Windows API 之 CreateThread、GetExitCodeThread(未完)

    GetExitCode Retrieves the termination status of the specified thread. BOOL WINAPI GetExitCodeThread( ...

  2. Hbase客户端API基础小结笔记(未完)

    客户端API:基础 HBase的主要客户端接口是由org.apache.hadoop.hbase.client包中的HTable类提供的,通过这个类,用户可以完成向HBase存储和检索数据,以及删除无 ...

  3. Windows API 学习

    Windows API学习 以下都是我个人一些理解,笔者不太了解windows开发,如有错误请告知,非常感谢,一切以microsoft官方文档为准. https://docs.microsoft.co ...

  4. 使用Windows API进行串口编程

    使用Windows API进行串口编程   串口通信一般分为四大步:打开串口->配置串口->读写串口->关闭串口,还可以在串口上监听读写等事件.1.打开和关闭串口Windows中串口 ...

  5. Windows API串口编程详解

    (一)Windows API串口通信编程概述 Windows环境下的串口编程与DOS环境下的串口编程有很大不同.Windows环境下的编程的最大特征之一就是设备无关性,它通过设备驱动程序将Window ...

  6. Linux与Windows API对比

    对象 操作 Linux API Windows API 线程 创建 pthread_create() CreateThread() 退出 pthread_exit() ThreadExit() 等待 ...

  7. [python]爬代理ip v2.0(未完待续)

    爬代理ip 所有的代码都放到了我的github上面, HTTP代理常识 HTTP代理按匿名度可分为透明代理.匿名代理和高度匿名代理. 特别感谢:勤奋的小孩 在评论中指出我文章中的错误. REMOTE_ ...

  8. Windows API学习---线程与内核对象的同步

    前言 若干种内核对象,包括进程,线程和作业.可以将所有这些内核对象用于同步目的.对于线程同步来说,这些内核对象中的每种对象都可以说是处于已通知或未通知的状态之中.这种状态的切换是由Microsoft为 ...

  9. Windows API学习---插入DLL和挂接API

    插入DLL和挂接API 在Microsoft Windows中,每个进程都有它自己的私有地址空间.当使用指针来引用内存时,指针的值将引用你自己进程的地址空间中的一个内存地址.你的进程不能创建一个其引用 ...

随机推荐

  1. android 动态string

    android开发过程之中,动态的插入string内容时候使用, 例如, <string name="time">当前时间:<xliff:g id="p ...

  2. php字符操作

    //一:定义字符串的方法 //1.双引号 //2.单引号 //3.heredoc语法结构 //heredoc语法定义字符串 $str=<<<TAG 我的武功终成武林盟主TAG;//注 ...

  3. void与void*详解

    void关键字的使用规则: 1. 如果函数没有返回值,那么应声明为void类型: 2. 如果函数无参数,那么应声明其参数为void: 3. 如果函数的参数可以是任意类型指针,那么应声明其参数为void ...

  4. robot framework -重点记录

    1.s2l打开的driver和webdriver打开的driver不是同一个driver. rf打开的浏览器.调用的是s2l的driver,而自己的库用的是webdriver的driver,这样在rf ...

  5. python 自动认证登录

    import urllib import base64 import urllib2 def auto_login(urllink,username,password): authstr = 'Bas ...

  6. C# 网上收集的一些所谓的开源项目

    C#开源 商业协作和项目管理平台-TeamLab 网络视频会议软件-VMukti 驰骋工作流程引擎-ccflow [免费]正则表达式测试工具-Regex-Tester Windows-Phone-7- ...

  7. Chapter 2 Open Book——9

    When I was finished with that, I took my book bag upstairs. Before starting my homework, I changed i ...

  8. MyBatis和SpringMVC集成事务在Junit测试下有效但是在实际项目无效的问题

    一.问题说明 项目框架采用SSM,集成了事务回滚(方式见下),在单元测试的时候,测试事务是有效的,但是在实际项目上线的时候,却没有效果. 二.集成方式 application-mybatis.xml( ...

  9. DOM操作-根据name获取网页中的全部复选框

    描述: 与id不同,多个元素可以使用相同的name属性,如果需要获取这一类元素的DOM对象,就需要使用getElementsByName()函数 代码: <!DOCTYPE html> & ...

  10. 1305: Substring

    #include <iostream>#include<string.h>#include<stdio.h> using namespace std; #defin ...