The kill_process function is used to destroy processes. Processes are destroyed by passing their process ID number to kill_process, according to the following syntax:
int kill_process(int pid)
kill_process returns a value indicating if the operation was successful. If the return value is 0, then the process was destroyed. If the return value is 1, then the process was not found.
The following code shows the main process creating a
check_sensor process, and then destroying it one second later:
void main() { int pid; pid= start_process(check_sensor(2)); sleep(1.0); kill_process(pid); }