mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-27 03:43:23 +00:00
chore: update docker image version in script && update doc (#1076)
* chore: update docker image version in script * chore: replace lots of spaces with newline in doc
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
  内核线程的创建是通过调用`KernelThreadMechanism::create()`或者`KernelThreadMechanism::create_and_run()`函数,向`kthreadd`守护线程发送创建任务来实现的。也就是说,内核线程的创建,最终是由`kthread_daemon`来完成。
|
||||
|
||||
  当内核线程被创建后,默认处于睡眠状态,要使用`ProcessManager::wakeup`函数将其唤醒。
|
||||
|
||||
  当内核其他模块想要停止一个内核线程的时候,可以调用`KernelThreadMechanism::stop()`函数,等待内核线程的退出,然后获得返回值并清理内核线程的pcb。
|
||||
|
||||
  内核线程应当经常检查`KernelThreadMechanism::should_stop()`的结果,以确定其是否要退出。当检测到需要退出时,内核线程返回一个返回码,即可退出。(注意资源的清理)
|
||||
|
Reference in New Issue
Block a user