pthread_kill_other_threads_npのヘルプ・マニュアル
日本語 英語
pthread_kill_other_threads_np --help
man pthread_kill_other_threads_np
PTHREAD_KILL_OTHER_THREADS_NP(3) PTHREAD_KILL_OTHER_THREADS_NP(3)
名前
pthread_kill_other_threads_np - 呼び出しスレッドを除くすべてのスレッド
を終了させる
書式
#include
void pthread_kill_other_threads_np(void);
説明
pthread_kill_other_threads_np はポータブルでない LinuxThreads の拡張 で
あ る。この関数は呼び出しスレッドを除く、プログラム中のすべてのスレッド
を直ちに終了させる。呼び出しスレッドはそのま ま 実 行 を 継 続 す る 。
pthread_kill_other_threads_np は、スレッドが execve(2) などの exec 関数
のうちの 1 つを呼び出す直前に使われることを想定している。
他のスレッドの終了は pthread_cancel(3) を働かせて行なわれるわけではなく
、 取り消し機構を完全に迂回する。すなわち、終了するスレッドの取り消し状
態や取り消し型に関する現在の設定は無視され、クリーンアップハンドラも 実
行されない。
著者
Xavier Leroy
関連項目
execve(2), pthread_setcancelstate(3), pthread_setcanceltype(3),
pthread_cancel(3).
バグ
POSIX 1003.1c 規格では、 1 つのスレッドで exec* が成功した場合、プロ グ
ラ ム中の他のスレッドはすべて自動的に終了されなければならないことになっ
ている。この振る舞いは LinuxThreads ではまだ実装されていない。 exec* の
前に pthread_kill_other_threads_np を呼び出すことで、次の点を除いてだい
たい同じ振る舞いを実現することができる。それは、結果として exec* が失敗
した場合でも、他のスレッドはすでに終了されているということである。
LinuxThreads PTHREAD_KILL_OTHER_THREADS_NP(3)
PTHREAD_KILL_OTHER_THREADS_Linux Programmer’s PTHREAD_KILL_OTHER_THREADS_NP(3)
NAME
pthread_kill_other_threads_np - terminate all other threads in process
SYNOPSIS
#include
void pthread_kill_other_threads_np(void);
DESCRIPTION
pthread_kill_other_threads_np() only has an effect in the LinuxThreads
threading implementation. On that implementation, calling this func-
tion causes the immediate termination of all threads in the applica-
tion, except the calling thread. The cancellation state and cancella-
tion type of the to-be-terminated threads are ignored, and the cleanup
handlers are not called in those threads.
CONFORMING TO
This function is a non-standard GNU extension.
NOTES
pthread_kill_other_threads_np() is intended to be called just before a
thread calls execve(2) or a similar function. This function is
designed to address a limitation in the obsolete LinuxThreads implemen-
tation whereby the other threads of an application are not automati-
cally terminated (as POSIX.1-2001 requires) during execve(2).
In the NPTL threading implementation, pthread_kill_other_threads_np()
exists, but does nothing. (Nothing needs to be done, because the
implementation does the right thing during an execve(2).)
SEE ALSO
execve(2), pthread_setcancelstate(3), pthread_setcanceltype(3),
pthread_cancel(3), pthreads(7)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2009-01-28 PTHREAD_KILL_OTHER_THREADS_NP(3)