简体   繁体   中英

pthreads signal a specific thread

In pthreads, is it possible for a thread to wake up another thread given only the other thread's id ?

(Kind of like, calling pthread_cond_signal() but with also a specific, known, thread id in mind)

您可以尝试使用sigaction()pthread_kill()

See the discussion between @Sam Hocevar and myself in response to this question ; the documentation says pthread_kill(3) delivers a signal to a specific thread, and I'm less sure about the Linux implementation sticking true to this requirement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM