Changes between Version 104 and Version 105 of processus_thread
- Timestamp:
- Aug 22, 2018, 5:55:39 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
processus_thread
v104 v105 125 125 == __5) Thread destruction__ == 126 126 127 The destruction of a target thread T can be caused by another thread K, executing the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_thread_cancel.c pthread_cancel()] syscall requesting the target thread T to stop execution. It can be caused by the thread T itself, executing the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_thread_exit.c pthread_exit()] syscall to suicide. Finally, it can be caused by the ''exit()'' or ''kill()''syscalls requesting the destruction of all threads of a given process.127 The destruction of a target thread T can be caused by another thread K, executing the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_thread_cancel.c pthread_cancel()] syscall requesting the target thread T to stop execution. It can be caused by the thread T itself, executing the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_thread_exit.c pthread_exit()] syscall to suicide. Finally, it can be caused by the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_exit.c exit()] or [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/syscalls/sys_kill.c kill()] syscalls requesting the destruction of all threads of a given process. 128 128 129 129 The unique method to destroy a thread is to call the '''thread_kill()''' function, that sets the THREAD_FLAG_REQ_DELETE bit in the ''flags'' field of the target thread descriptor. The thread will be asynchronously deleted by the scheduler at the next scheduling point.