static void _GlobalApplyAutoDependenciesToOperation()

in Source/TNLRequestOperationQueue.m [100:118]


static void _GlobalApplyAutoDependenciesToOperation(TNLRequestOperation *op)
{
    const NSInteger dependencyThreshold = (NSInteger)[TNLGlobalConfiguration sharedInstance].operationAutomaticDependencyPriorityThreshold;
    if (dependencyThreshold < NSIntegerMax) {
        if (op.priority > dependencyThreshold) {
            // Auto dependency operation encountered!
            _GlobalAddAutoDependencyOperation(op);
        } else {
            // Add outstanding auto dependency operations as dependencies
            NSArray<TNLRequestOperation *> *autoDependencies = _GlobalAutoDependencyOperations();
            if (autoDependencies.count > 0) {
                TNLLogInformation(@"Marking %@ dependent on %tu higher priority operations", op, autoDependencies.count);
                for (TNLRequestOperation *depOp in autoDependencies) {
                    [op addDependency:depOp];
                }
            }
        }
    }
}