module top;
initial begin:i1
fork:f3
#10 $display("pkt_interrupt handler");
join_none
$display("getting the packet");
t1();
end
task t1();
fork
begin:a1
#1 $display("get preamble");
end
begin:a2
#2 $display("get header");
end
join_none
fork
begin:a3
#5 $display("get payload");
end
begin:a4
#6 $display("get packet_timeout");
end
join_any
disable fork;
$display("Processing packet");
endtask
endmodule
This code prints
# getting the packet
# get preamble
# get header
# get payload
# Processing packet
Why is the disable fork killing the fork f3 as well? Shouldn’t it only disable the threads spawned by the process which executed disable fork which is task t1()?