146 | | The thread destruction is more complex if the target thread T is running in ATTACHED mode, because another joining thread J, executing the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_thread_join.c pthread_join()] syscall, must be informed of the termination of thread T. As the '''thread_delete()''' function (executed by the killer thread K) and the '''sys_thread_join()''' (executed by the joining thread J) can be executed in any order, this requires a "rendez-vous": The first arrived thread blocks and deschedules. It will be unblocked by the other thread. |
147 | | |
148 | | This destruction mechanism can therefore involve three threads: the target thread T, the killer thread K, and the joining thread J: |
| 146 | The thread destruction is more complex if the target thread T is running in ATTACHED mode, because another joining thread J must be informed of the termination of thread T. As the '''thread_delete()''' function (executed by the killer thread K) and the '''sys_thread_join()''' function (executed by the joining thread J) can be executed in any order, this requires a "rendez-vous": The first arrived thread blocks and deschedules. It will be unblocked by the other thread. |
| 147 | |
| 148 | The destruction mechanism can therefore involve three threads: the target thread T, the killer thread K, and the joining thread J. It |