Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Data.Instance.TaskCheck_threadList.Clear();

            for (int i = 0; i < 10; i++)
            {
                string strid = string.Format("thr{0}", i);

                TaskCheck_class taskcheck = new TaskCheck_class();

                taskcheck.taskthred = new Thread(taskcheck.taskCheck_thread_func);
                taskcheck.taskthred.Start(strid);

                Data.Instance.TaskCheck_threadList.Add(taskcheck);
            }
        }
Example #2
0
        public void TaskFinished(string strtaskid)
        {
            try
            {
                lock (this)
                {
                    //db 정보 갱신
                    dbBridge.onDBUpdate_Tasklist_status(strtaskid, "wait");

                    //task operation db 삭제
                    dbBridge.onDBDelete_TaskOperation(strtaskid, "");

                    Data.Instance.bMissionCompleteCheck = false;

                    //쓰레드 삭제
                    int threadcnt = Data.Instance.TaskCheck_threadList.Count;
                    if (threadcnt > 0)
                    {
                        int             thridx    = 0;
                        TaskCheck_class taskclass = Data.Instance.TaskCheck_threadList.ElementAt(thridx);

                        if (taskclass.strTaskid == strtaskid)
                        {
                            if (taskclass.taskthred != null)
                            {
                                taskclass.taskthred.Abort();
                                taskclass = null;
                            }

                            Data.Instance.TaskCheck_threadList.RemoveAt(thridx);
                        }
                    }

                    if (Data.Instance.nFormidx == (int)Data.FORM_IDX.Operaion_TaskForm)
                    {
                        taskopCtrl.onInitSet();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("TaskFinished err=" + ex.Message.ToString());
            }
        }