public void SetThreadShareParam(int workId, ThreadGroup threadGroup, EudiSynchronizationType syncType = EudiSynchronizationType.Unity)
        {
            if (threadGroup.UseDefaultTasks)
            {
                var        firstCreation = false;
                WorkerTask task          = null;
                if (!threadGroup.Tasks.TryGetValue(workId, out task))
                {
                    task        = EudiThreading.CreateTask();
                    task.TaskId = workId;

                    threadGroup.Tasks[workId] = task;

                    firstCreation = true;
                }

                if (task != null)
                {
                    task.SynchronizationType = syncType;

                    OnNewWorkerTask(task, firstCreation);

                    m_threadGroups.Add(threadGroup);

                    task.Workers.Add(this);

                    m_workerTasks.Add(task);
                }
            }
            else
            {
                threadGroup.CreateFromWorker(this, workId, syncType);
                m_threadGroups.Add(threadGroup);
            }
        }
Beispiel #2
0
 public virtual void CreateFromWorker(EudiComponentWorker worker, int workId, EudiSynchronizationType type)
 {
 }
Beispiel #3
0
 public override void CreateFromWorker(EudiComponentWorker worker, int workId, EudiSynchronizationType syncType)
 {
     Workers.Add(new WorkerWithWorkId()
     {
         Worker = worker, WorkId = workId
     });
 }