From 1f11d41e9f157b2b66ed50bbb4f0a95a9f5d3318 Mon Sep 17 00:00:00 2001 From: chenyf <1343619937@qq.com> Date: Sat, 24 Feb 2024 10:10:20 +0800 Subject: [PATCH] 1 --- fock/fock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fock/fock.c b/fock/fock.c index 7473e04..57a4c7a 100644 --- a/fock/fock.c +++ b/fock/fock.c @@ -28,6 +28,12 @@ int main(void) // } // fock创建进程 // fock创建的子进程一般用来执行新的程序 + /** + * 创建一个信号量用于唤醒进程 + * 子进程睡眠10s + * 父进程睡眠1s后,把子进程叫醒 + * 子进程结束后,父进程结束 + */ signal(SIGUSR1,weak_process); pid_t pid = fork(); if (pid == 0)