Changeset View
Changeset View
Standalone View
Standalone View
share/man/man3/pthread_join.3
Context not available. | |||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd February 3, 2018 | .Dd February 13, 2019 | ||||
.Dt PTHREAD_JOIN 3 | .Dt PTHREAD_JOIN 3 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm pthread_join , | .Nm pthread_join , | ||||
.Nm pthread_peekjoin_np , | |||||
.Nm pthread_timedjoin_np | .Nm pthread_timedjoin_np | ||||
.Nd wait for thread termination | .Nd inspect thread termination | ||||
markj: Maybe "inspect thread termination state"? | |||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libpthread | .Lb libpthread | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
Context not available. | |||||
.Fn pthread_join "pthread_t thread" "void **value_ptr" | .Fn pthread_join "pthread_t thread" "void **value_ptr" | ||||
.In pthread_np.h | .In pthread_np.h | ||||
.Ft int | .Ft int | ||||
.Fn pthread_timedjoin_np "pthread_t thread" "void **value_ptr" "const struct timespec *abstime" | .Fo pthread_peekjoin_np | ||||
.Fa "pthread_t thread" | |||||
.Fa "void **value_ptr" | |||||
.Fc | |||||
.Ft int | |||||
.Fo pthread_timedjoin_np | |||||
.Fa "pthread_t thread" | |||||
.Fa "void **value_ptr" | |||||
.Fa "const struct timespec *abstime" | |||||
.Fc | |||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Fn pthread_join | .Fn pthread_join | ||||
Context not available. | |||||
.Er ETIMEDOUT | .Er ETIMEDOUT | ||||
if target thread does not exit before specified absolute time passes. | if target thread does not exit before specified absolute time passes. | ||||
.Pp | .Pp | ||||
The | |||||
.Fn pthread_peekjoin_np | |||||
only peeks into the exit status of the specified thread. | |||||
If the thread did not exited yet, the | |||||
Done Inline Actions"If the thread has not exited, the ..." markj: "If the thread has not exited, the ..." | |||||
.Er EBUSY | |||||
error is returned. | |||||
Otherwise, zero is returned and the thread exit value is optionally stored | |||||
into the location of | |||||
.Fa *value_ptr . | |||||
The target thread is left unjoined and can be used as an argument for | |||||
the | |||||
.Fn pthread_join | |||||
family of functions again. | |||||
.Pp | |||||
A thread that has exited but remains unjoined counts against | A thread that has exited but remains unjoined counts against | ||||
[_POSIX_THREAD_THREADS_MAX]. | [_POSIX_THREAD_THREADS_MAX]. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
If successful, the | If successful, the described functions return zero. | ||||
.Fn pthread_join | Otherwise an error number is returned to indicate the error or | ||||
and | special condition. | ||||
.Fn pthread_timedjoin_np | |||||
functions will return zero. | |||||
Otherwise an error number will be returned to | |||||
indicate the error. | |||||
.Sh ERRORS | .Sh ERRORS | ||||
The | The | ||||
.Fn pthread_join | .Fn pthread_join , | ||||
.Fn pthread_peekjoin_np , | |||||
and | and | ||||
.Fn pthread_timedjoin_np | .Fn pthread_timedjoin_np | ||||
functions will fail if: | functions will fail if: | ||||
Context not available. | |||||
.Fn pthread_timedjoin_np | .Fn pthread_timedjoin_np | ||||
waited for thread exit. | waited for thread exit. | ||||
.El | .El | ||||
.Pp | |||||
The | |||||
.Fn pthread_peekjoin_np | |||||
function will also fail if: | |||||
.Bl -tag -width Er | |||||
.It Bq Er EBUSY | |||||
The specified thread did not yet exited. | |||||
Done Inline Actions"did not yet exit" or "has not yet exited". I think the second one is more consistent with the rest of the man page. markj: "did not yet exit" or "has not yet exited". I think the second one is more consistent with the… | |||||
.El | |||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr wait 2 , | .Xr wait 2 , | ||||
.Xr pthread_create 3 | .Xr pthread_create 3 | ||||
Context not available. | |||||
.Fx | .Fx | ||||
extension which first appeared in | extension which first appeared in | ||||
.Fx 6.1 . | .Fx 6.1 . | ||||
Another extension, the | |||||
.Fn pthread_peekjoin_np | |||||
function, first appearead in | |||||
.Fx 13.0 . | |||||
Context not available. |
Maybe "inspect thread termination state"?