什么是线程?线程和进程谁更弔?

慈云数据 2024-04-19 技术支持 48 0

第一个参数是所创建进程的pid。

第二个是线程的属性。

第三个参数是返回值为void*,参数也为void*的函数指针。 

第四个参数是给第三个参数的参数,也就是给给函数传参。

#inClude
#include
#include
using NAMEspace std;
//新线程
void *ThreadRoutine(void*args)
{
    const char*threadname=(const char*)args;
    while(true)
    {
        cout
微信扫一扫加客服

微信扫一扫加客服

点击启动AI问答
Draggable Icon