簡體   English   中英

pthread_create function 的第一個參數是線程處理程序嗎

[英]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 的手冊頁

有關 pthread_create() 在*thread中返回的線程 ID 的更多信息,請參見pthread_self(3 pthread_create()

您也可以將其稱為句柄(而不是處理程序)。

您可以將該 ID 用於pthread_join

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM