Hey! I see two ways to do this:
First one - use
proc_status.
Second one - use global variable, which will change to ONE at the beggining of that 'test' function, and will be reset back to ZERO when you rich the end of the function (after f.e. a loop). So you'll be able to check, if that variable is equal to ONE, then wait for that function.. Just a dirty but well working idea.
Best regards!