OC 线程操作1 - pthread
2024-10-12 05:54:22
#import "ViewController.h"
#import <pthread.h> //1.需要包含这个头文件
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
//2.创建线程对象
pthread_t p;
//3.创建线程
/*
参数1 : pthread_t _Nullable *restrict _Nonnull, 线程对象,传递地址
参数2 : const pthread_attr_t *restrict _Nullable, 线程属性 , NULL
参数3 : void * _Nullable (* _Nonnull)(void * _Nullable), 指向函数的指针
参数4 : void *restrict _Nullable, 函数需要的参数
*/
pthread_create(&p, NULL, task, NULL);
}
void *task(void *pama){
return NULL;
}
@end
最新文章
- maven环境配置+eclipse环境配置
- Linq专题之创建Linq查询表达式
- C# - Dbhelp
- python模拟http请求
- about mobile web
- diy 电脑 重装系统
- #include <;locale.h>; #include <;locale>;
- MVC-04 视图(1)
- python--help
- Route@简单应用
- Nignx入门location、root配置
- Expected MultipartHttpServletRequest: is a MultipartResolver configured解决方案
- 2017 Multi-University Training Contest - Team 1 1006&;&;HDU 6038 Function【DFS+数论】
- 【BZOJ3680】吊打XXX(模拟退火)
- Mysql之库表操作(胖胖老师)
- latex中长公式换行,很好的办法
- 舵机&;数据处理&;stm32内存之堆栈溢出(遇到的问题)
- rediret 加/与不加/的区别
- sqlserver数据库不能重命名报错5030
- asynchronous.js
热门文章
- SSL 链接安全协议的enum
- 趣味编程:静夜思(Python版)
- [PHP]防止表单重复提交的几种方法
- 关于T-SQL中exists或者not exists子查询的“伪优化”的做法
- [图解tensorflow源码] 入门准备工作附常用的矩阵计算工具[转]
- Out of range value for column &#39;phon&#39; at row 1
- Python中struct.pack()和struct.unpack()
- soap 简单调用其他系统的函数
- HashMap、LinkedHashMap、ConcurrentHashMap、ArrayList、LinkedList 底层实现
- QPS/TPS/并发量/系统吞吐量的概念