结果:
Parent has x = 0;
Bye from process () with x = 0;
Child has x = 2;
Bye from process () with x = 2;
结果:
父进程:L0 L1 Bye
子2:Bye
子1:L1 Bye
孙:Bye
结果:
父进程:L0 L1 L2 Bye
子3:Bye
子2:L2 Bye
子1:L1 L2 Bye
孙3:Bye
孙2:Bye
孙1:L2 Bye
孙_子1:Bye
结果:
父进程:L0 L1 L2 Bye
子2:Bye
子1:Bye
拓展:
若上图两个if并列无嵌套