2024年3月20日发(作者:)
beginthread和beginthreadex的使用方法
建立一个线程。
unsigned long beginthread(void(cdecl *startaddress)(void*),unsigned
stacksize, void *arglist);
unsigne dlong
*security,unsignedstacksize,unsigned(stdcall *startaddress)
*arglist,unsignedinitflag,unsigned *thrdaddr);
例程 需要的头文件 兼容性
beginthread
beginthreadex
对于另外兼容性的信息,参见引言中的兼容性
库
单线程静态库,零售版本
多线程静态库,零售版本
的输入库,零售版本
(void *), void
beginthreadex(void
为了使用beginthread或beginthreadex,该应用必须与多线程C运行库之一进行链
接。
返回值
如果成功,这些函数返回最近建立的线程的句柄,出现一个错误时,beginthread返回-1
在这种情况下如果有太多的线程,则errno设置为EAGAIN,如果参量无效或栈尺寸不正确,
则errno设置为EINVAL。在出现一个错误时,beginthreadex返回0,这种情况下errno和
doserrno都被设置。
参数
startaddress
开始执行新线程的例程的起始地址。
Stacksize
新线程的栈尺寸或0。
Arglist
传递给新线程的参量表或NULL。
Security


发布评论