Учитывая только идентификатор потока, можно ли оттуда решить, жив ли поток или нет?Я говорю о C ++ в Linux.
С справочной страницы:
ОПИСАНИЕ The pthread_kill() function shall request that a signal be deliv- ered to the specified thread. As in kill(), if sig is zero, error checking shall be performed but no signal shall actually be sent.
ОПИСАНИЕ
The pthread_kill() function shall request that a signal be deliv- ered to the specified thread. As in kill(), if sig is zero, error checking shall be performed but no signal shall actually be sent.
так:
bool isalive(int threadid) { return pthread_kill(threadid, 0) != ESRCH; }