简体   繁体   English

pthread_create function 的第一个参数是线程处理程序吗

[英]Is the first argument to pthread_create function a thread handler

The Linux man page defines the pthread_create function as Linux 手册页将 pthread_create function 定义为

int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
                          void *(*start_routine) (void *), void *arg);

What's this pointer to the pthread_t used for?这个指向 pthread_t 的指针是做什么用的? Can we say it's a thread handler?我们可以说它是一个线程处理程序吗?

From the manpage of pthread_create :pthread_create 的手册页

See pthread_self(3) for further information on the thread ID returned in *thread by pthread_create() .有关 pthread_create() 在*thread中返回的线程 ID 的更多信息,请参见pthread_self(3 pthread_create()

You can also call it a handle (not handler).您也可以将其称为句柄(而不是处理程序)。

You can use that ID for pthread_join .您可以将该 ID 用于pthread_join

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM