Can i use fork.. join / fork .. join_any inside of a function

In reply to pkoti0583:
hi…
In example one perfectly working.
In example two you use a delay inside a function,So it will through a error.
Only use delay in task can’t use in function.Because a function is zero simulation time.