摘要: 转自http://www.xuebuyuan.com/1304408.html 使用临界区对象(CriticalSection)需要注意的一些事情 1. 临界区对象不是内核对象,因此不能继承,不能跨进程,也不能用waitfor什么的函数来限定时间等待。这个很好理解,你想想WaitFor要求传一个句柄 阅读全文
posted @ 2017-06-02 16:10 言止予思 阅读(2232) 评论(0) 推荐(0) 编辑
摘要: connect()用于建立与指定socket的连接。 头文件: #include <sys/socket.h> 函数原型: int connect(int s, const struct sockaddr * name, int namelen); 参数: s:标识一个未连接socket name: 阅读全文
posted @ 2017-06-02 14:52 言止予思 阅读(16530) 评论(0) 推荐(0) 编辑
摘要: 转自http://blog.sina.com.cn/s/blog_6163bdeb0100qlw1.html 系统核心对象中的Event事件对象,在进程、线程间同步的时候是比较常用,发现它有两个出发函数,一个是SetEvent,还有一个PulseEvent,两者的区别是: SetEvent为设置事件 阅读全文
posted @ 2017-06-02 14:40 言止予思 阅读(1253) 评论(0) 推荐(0) 编辑