zoukankan      html  css  js  c++  java
  • 创建线程方式-pthread

     pthread

    pthread的基本使用(需要包含头文件<ptheard.h>)
        //使用pthread创建线程对象
        pthread_t thread;
        NSString *name = @"daquan";
        //使用pthread创建线程
        //第一个参数:线程对象地址(有两个*即要传入地址)
        //第二个参数:线程属性
        //第三个参数:指向函数的指针
        //第四个参数:传递给该函数的参数
        pthread_create(&thread, NULL, run, (__bridge void *)(name));


  • 相关阅读:
    十个MySQL常用函数
    写给三十岁的自己
    EJS 模板引擎
    发送HTTP请求(GET,POST)
    路由模块化
    原生NodeJS封装Express路由
    Hook简介
    State Hook (useState)
    Effect hooks
    useContext
  • 原文地址:https://www.cnblogs.com/zhoudaquan/p/5080243.html
Copyright © 2011-2022 走看看