jpman project specific RCS keyword (jpman %Id) is obsolete, after manual entries are stored in freefall CVS repository. This old Id is useless and more worse it confuses users and bug reporters. So, this old Id is removed. Submitted by:jpman project <man-jp@jp.FreeBSD.org>
105 lines
3.5 KiB
Groff
105 lines
3.5 KiB
Groff
.\" Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>.
|
|
.\" All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by John Birrell.
|
|
.\" 4. Neither the name of the author nor the names of any co-contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd April 4, 1996
|
|
.Dt PTHREAD_EXIT 3
|
|
.Os BSD 4
|
|
.Sh 名称
|
|
.Nm pthread_exit
|
|
.Nd 呼び出しスレッドの終了
|
|
.Sh 書式
|
|
.Fd #include <pthread.h>
|
|
.Ft void
|
|
.Fn pthread_exit "void *value_ptr"
|
|
.Sh 解説
|
|
.Fn pthread_exit
|
|
関数は、呼び出しスレッドを終了し、終了スレッドとの結合に
|
|
.Fa value_ptr
|
|
の値を使用できるようにします。プッシュされたがまだポップされていない
|
|
キャンセルクリーンアップハンドラは、プッシュと逆の順序でポップ
|
|
されて実行されます。すべてのキャンセルハンドラが実行された後で
|
|
スレッドに固有なデータがスレッドにある場合は、適切な破壊関数が
|
|
順序不定で呼び出されます。スレッドが終了しても、
|
|
MUTEX
|
|
とファイル記述子等のアプリケーションのプロセスリソースは
|
|
解放されませんし、存在する可能性がある
|
|
.Fn atexit
|
|
関数の呼び出し等のプロセスレベルのクリーンアップアクションも
|
|
実行されません。
|
|
.Pp
|
|
.Fn main
|
|
を最初に呼び出したスレッド以外のスレッドが、作成に使用された
|
|
開始ルーチンから戻った場合は、
|
|
.Fn pthread_exit
|
|
が暗黙のうちに呼び出されます。
|
|
関数の戻り値は、スレッドの終了ステータスとして使用されます。
|
|
.Pp
|
|
.Fn pthread_exit
|
|
を暗黙のうちにあるいは明示的に呼び出したために
|
|
起動されたキャンセルハンドラや破壊関数から呼び出された
|
|
.Fn pthread_exit
|
|
の動作は未定義です。
|
|
.Pp
|
|
スレッドが終了した後では、スレッドのローカル
|
|
(
|
|
自動
|
|
)
|
|
変数へのアクセス結果は不定になります。
|
|
.Fn pthread_exit
|
|
の
|
|
.Fa value_ptr
|
|
パラメータに、終了するスレッドのローカル変数の参照を
|
|
使用しないでください。
|
|
.Pp
|
|
最後のスレッドが終了した後では、プロセスは終了ステータス
|
|
0
|
|
で終了します。実装がスレッドの終了時に引数をゼロにして
|
|
.Fn exit
|
|
を呼び出したような動作となります。
|
|
.Pp
|
|
.Sh 戻り値
|
|
.Fn pthread_exit
|
|
関数は、呼び出し側に復帰できません。
|
|
.Sh エラー
|
|
ありません。
|
|
.Pp
|
|
.Sh 関連項目
|
|
.Xr _exit 2 ,
|
|
.Xr exit 2 ,
|
|
.Xr pthread_create 3 ,
|
|
.Xr pthread_join 3
|
|
.Sh 規格
|
|
.Fn pthread_exit
|
|
は、
|
|
ISO/IEC 9945-1 ANSI/IEEE
|
|
.Pq Dq Tn POSIX
|
|
Std 1003.1 Second Edition 1996-07-12
|
|
に準拠しています。
|