You can use the process inbuild class in the system verilog to monitor each process . Using the process the the code will changed like this . please note as per your code the every thread will finish same time i am writing the code will take care if your thread time will change aslo .
// or browse Examples
module tb;
if you modifed to this after any two process the disable will work
module tb;
process p1,p2,p3;
initial
begin
fork : A
begin:Thread1
p1=process::self();
#8;
$display("Inside Thread 1");
end:Thread1
begin:Thread2
p2=process::self();
#12;
$display("Inside Thread 2");
end:Thread2
begin:Thread3
p3=process::self();
#3;
$display("Inside Thread 3");
end:Thread3
join_none : A
wait (p1!=null && p2!=null && p3!=null) // waiting for the three process gets the value
fork
begin
p1.await ;
p2.await;
end
begin
p1.await ;
p3.await;
end
begin
p2.await ;
p3.await;
end
join_any
$display("time of after two process ends",$time);
disable fork;
end
endmodule
Interesting solution, but what happens if you wanted to add one or a few more processes? The amount of code you would have add becomes unmanageable. Using a semaphore is straightforward.