[英]Is the first argument to pthread_create function a thread handler
Linux 手冊頁將 pthread_create function 定義為
int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg);
這個指向 pthread_t 的指針是做什么用的? 我們可以說它是一個線程處理程序嗎?
有關 pthread_create() 在
*thread
中返回的線程 ID 的更多信息,請參見pthread_self(3pthread_create()
。
您也可以將其稱為句柄(而不是處理程序)。
您可以將該 ID 用於pthread_join
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.