Is there an invalid pthread_t id?

前端 未结 6 2055
说谎
说谎 2020-12-13 05:43

I would like to call pthread_join for a given thread id, but only if that thread has been started. The safe solution might be to add a variable to track which thread where s

6条回答
  •  攒了一身酷
    2020-12-13 06:33

    Unfortunately, on systems where pthread_t is a pointer, pthread_equal() can return equality even though the two args refer to different threads, e.g. a thread can exit and a new thread can be created with the same pthread_t pointer value.

提交回复
热议问题