How is pthread_join implemented?

前端 未结 3 1895
轻奢々
轻奢々 2020-12-10 13:39

I\'m a little new to threading, so you\'ll have to forgive the naiveté of this question.

How is pthread_join implemented and how does it effect thread s

3条回答
  •  渐次进展
    2020-12-10 14:25

    pthread_join is probably internally implemented as a wait for a semaphore which is triggered when the thread exits, either when it calls pthread_exit or when its main function exits.

    In any case, the source code for glibc is available, try google code search (I saw some informative stuff in there)

提交回复
热议问题