예제 #1
0
    /** 执行添加任务目标 */
    private void doAddRunningTask(TaskData data)
    {
        _runningTaskDic.put(data.instanceID, data);

        TaskTypeConfig tConfig;

        //双键
        if ((tConfig = TaskTypeConfig.get(data.config.type)).needSecondKey)
        {
            _runningTaskTypeTwoDic.computeIfAbsent((long)data.config.type << 32 | data.config.args[1], k => new IntObjectMap <TaskData>()).put(data.instanceID, data);

            if (tConfig.needSecondKey2)
            {
                _runningTaskTypeTwoDic2.computeIfAbsent((long)data.config.type << 32 | data.config.args[2], k => new IntObjectMap <TaskData>()).put(data.instanceID, data);
            }
        }
        //单键
        else
        {
            _runningTaskTypeOneDic.computeIfAbsent(data.config.type, k => new IntObjectMap <TaskData>()).put(data.instanceID, data);
        }
    }