当前位置:网站首页>【C语言】开启一个线程
【C语言】开启一个线程
2022-06-29 03:44:00 【嵌入式职场】
目录
1、线程函数
每一个线程都有一个唯一的线程 ID,ID 类型为 pthread_t,这个 ID 是一个无符号长整形数,如果想要得到当前线程的线程 ID,可以调用如下函数:
- 返回当前线程的线程ID
pthread_t WINPTHREAD_API pthread_self(void);在一个进程中调用线程创建函数,就可得到一个子线程,和进程不同,需要给每一个创建出的线程指定一个处理函数,否则这个线程无法工作。
int WINPTHREAD_API pthread_create(pthread_t *th, const pthread_attr_t *attr, void *(* func)(void *), void *arg);边栏推荐
- [tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (I)
- Zhai Jia: from technical engineer to open source entrepreneur of "net red"
- [tcapulusdb] I wish you all a healthy Dragon Boat Festival!
- 【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(一)
- 19.03 vessel description and simple application examples continued
- Seura 2 test code summary
- leetcode:304. 二维区域和检索 - 矩阵不可变
- 微秒级 TCP 时间戳
- MySQL复习资料(附加)case when
- How to back up all data on Apple mobile phone in 2 steps (free)
猜你喜欢

leetcode:560. Subarray with and K

The efficiency of 20 idea divine plug-ins has been increased by 30 times, and it is necessary to write code

Go implements distributed locks

【TcaplusDB知识库】修改业务修改集群cluster
![[tcaplusdb knowledge base] view tcapdir directory server](/img/b6/f3734dfb03ec789525636335457b99.png)
[tcaplusdb knowledge base] view tcapdir directory server

迅为龙芯开发板pmon下Ejtag-设置硬件断点指令

微秒级 TCP 时间戳
![[tcapulusdb knowledge base] modify business modify cluster](/img/a6/e8067809c8a5d8a222b0ad0d545591.png)
[tcapulusdb knowledge base] modify business modify cluster

Share 60 divine vs Code plug-ins

Ugui slider minimum control
随机推荐
Source code analysis of go redsync distributed lock
Inventory deduction based on redis
【TcaplusDB知识库】TcaplusDB-tcaplusadmin工具介绍
MySQL Varcahr to int
Solid state and memory module purchase
Data statistical analysis (SPSS) [4]
Installation and deployment of sw-x framework
Vg4131sxxxn0s1 wireless module hardware specification
Data collection and management [1]
【TcaplusDB知识库】TcaplusDB数据导入介绍
[nrf51][nrf52] nrfconnect installation instructions guide
leetcode:560. Subarray with and K
87. (cesium chapter) cesium thermal map (pasted with terrain)
【TcaplusDB】祝大家端午安康!
Error: schema validation failed with the following error: the data path '' should not have other properties (projects)
【FPGA+sin】基于DDS(直接数字合成)的正弦信号发生器模块FPGA实现
Data statistical analysis (SPSS) [3]
Wechat applet development Basics
Seura 2 test code summary
【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(一)