示例#1
0
/*!	Checks recursively if the requirements of the specified job can be launched,
	if they are not running already.
	Calling this method will not trigger a demand for the requirements.
*/
bool
LaunchDaemon::_CanLaunchJobRequirements(Job* job, uint32 options)
{
	int32 count = job->Requirements().CountStrings();
	for (int32 index = 0; index < count; index++) {
		Job* requirement = FindJob(job->Requirements().StringAt(index));
		if (requirement != NULL
			&& !requirement->IsRunning() && !requirement->IsLaunching()
			&& (!_CanLaunchJob(requirement, options, true)
				|| _CanLaunchJobRequirements(requirement, options))) {
			requirement->AddPending(job->Name());
			return false;
		}
	}

	return true;
}