pthraed_create()传递参数
时间: 2023-10-18 16:31:08 浏览: 153
pthread_create()函数传递的参数包括以下几个:
1. thread:指向pthread_t类型的变量,用于存储新创建线程的ID。
2. attr:指向pthread_attr_t类型的变量,用于设置线程的属性。可以通过该参数指定线程的调度策略、栈大小、优先级等属性。
3. start_routine:指向函数的指针,该函数将作为线程的入口点,新线程将从该函数开始执行。
4. arg:传递给start_routine函数的参数,可以是任意类型的指针。在start_routine函数内部可以通过强制类型转换获取该参数的值。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [C++多线程](https://blog.csdn.net/qq_38502736/article/details/103830913)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [c++ linux pthread函数](https://blog.csdn.net/lileiyuyanqin/article/details/78212305)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文