proc_status (EVENT name)
proc_status2 (EVENT name, ENTITY* ent)
Checks how many instances of a given function
started by the given entity are currently running simultaneously.
name - pointer of the function.
ent - pointer of the my entity of the function.
0 = no function instance running.
>0 = number of instances running.
Many instances of the same function can run simultaneously when the function contains wait statements.
- The function from which proc_status() is called is not counted as an instance.
- The wait_for
and wait_for_my macros use proc_status() as a convenient way to check whether a function is finished (see example). They are defined in acknex.h:
#define wait_for(f) while (proc_status(f)) wait(1)
#define wait_for_my(f) while (proc_status(f,my)) wait(1)
myfunction(myparameter); // call a function with many wait()s (one instance only)
wait_for(myfunction); // wait until myfunction is finished (lite-C only)
function, wait, proc_late