Windows下pthread多线程使用(3):ExitThread
来源:互联网 发布:2016年做淘宝赚钱吗 编辑:程序博客网 时间:2024/05/22 00:34
声明同上一篇文章,以下是代码
#include <cmnheader.h>const int THREADFAIL = 1;const int THREADPASS = 0;void *theThread(void *parm){printf("Thread: End with success\n");pthread_exit(__VOID(THREADPASS));printf("Thread: Did not expect to get here!\n");return __VOID(THREADFAIL);}int main(int argc, char **argv){pthread_t thread;int rc = 0;void *status;printf("Enter Testcase - %s\n", argv[0]);printf("Create/start a thread\n");rc = pthread_create(&thread, NULL, theThread, NULL);checkResults("pthread_create()\n", rc);printf("Wait for the thread to complete, and release its resources\n");rc = pthread_join(thread, &status);checkResults("pthread_join()\n", rc);printf("Check the thread status\n");if (__INT(status) != THREADPASS){printf("The thread failed\n");}printf("Main completed\n");system("pause");return 0;}
0 0
- Windows下pthread多线程使用(3):ExitThread
- Windows下pthread多线程使用(1):准备工作
- Windows下pthread多线程使用(2):CreateThread
- Windows下pthread多线程使用(4):CancelThread
- Windows下pthread多线程使用(5):WaitForAnEnd
- Windows下使用pthread
- Windows下使用pthread
- windows 下使用 pthread
- Windows下使用pthread
- Windows下使用pthread
- windows 下使用pthread
- Windows下使用pthread
- Windows下使用pthread
- Windows下使用pthread
- windows下使用pthread
- Windows下使用pthread
- Windows下使用pthread
- windows下使用pthread库
- 在Tomcat中部署war
- android判断桌面快捷方式之升级版
- java入门学习指导之最佳方向
- Mathematica和Matlab共用net的dll
- Freewheel笔试面试题
- Windows下pthread多线程使用(3):ExitThread
- 主板常见故障维修
- 用Java实现的单倍长密钥DES、双倍长密钥3DES和Mac计算
- ArcGIS API for Flex求线段的起点、终点和中点
- 第四周作业——图的表示
- 网站推广 seo优化 教程102条
- PB --TreeView实现同步选择
- Eclipse使用入门教程
- 九度Online Judge上部分题目代码