| aMulti_Halt | Index |
Definition:
| void aMulti_Halt( | char callingProcID, int retval); |
Parameters:
| callingProcID | - | The index of process that launched the subprocess. |
| retval | - | A return value to be passed back to the calling process via a sempahore. |
Return Value:
Description:
This routine must be the final command in a TEA file that was executed using one of the functions with an aMulti_Run prefix. It signals completion to the calling process via a semaphore. The semaphore also passes a return value to the calling process.
Example:
(TEA file stored in file slot 0)
#include <aMulti.tea>
void main()
{
int n;
n = aMulti_Run00(1,3);
}
(TEA file stored in file slot 1)
#include <aMulti.tea>
void main(char callingProcID)
{
aMulti_Halt(callingProcID,100);
}
The first program (0) runs the second program (1) as process 3. After executing the aMulti_Run00 command, the first program waits until the second program completes execution. The second program exits and returns a value of 100 to the first program. The first program assigns that return value to variable n.
Related: