📄 pthread_create.man
字号:
.TH PTHREAD_CREATE 3 LinuxThreads.SH NAMEpthread_create \- create a new thread.SH SYNOPSIS#include <pthread.h>int pthread_create(pthread_t * thread, pthread_attr_t * attr, void * (*start_routine)(void *), void * arg);.SH DESCRIPTION!pthread_create! creates a new thread of control that executesconcurrently with the calling thread. The new thread applies thefunction |start_routine| passing it |arg| as first argument. The newthread terminates either explicitly, by calling !pthread_exit!(3),or implicitly, by returning from the |start_routine| function. Thelatter case is equivalent to calling !pthread_exit!(3) with the resultreturned by |start_routine| as exit code.The |attr| argument specifies thread attributes to be applied to thenew thread. See !pthread_attr_init!(3) for a complete list of threadattributes. The |attr| argument can also be !NULL!, in which casedefault attributes are used: the created thread is joinable (notdetached) and has default (non real-time) scheduling policy..SH "RETURN VALUE"On success, the identifier of the newly created thread is stored inthe location pointed by the |thread| argument, and a 0 is returned. Onerror, a non-zero error code is returned..SH ERRORS.TP!EAGAIN!not enough system resources to create a process for the new thread..TP!EAGAIN!more than !PTHREAD_THREADS_MAX! threads are already active..SH AUTHORXavier Leroy <Xavier.Leroy@inria.fr>.SH "SEE ALSO"!pthread_exit!(3),!pthread_join!(3),!pthread_detach!(3),!pthread_attr_init!(3).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -