static void submitBlock(ReorgBlock execInfo) { string canSubmitInfo; if (canSubmit(execInfo.BlockName, out canSubmitInfo)) { Thread execThread; Interlocked.Increment(ref threadsRunning); execThread = new Thread(new ThreadStart(execInfo.ExecuteBlock)); execThread.Start(); } else { execInfo.StatusInfo.Status = ReorgBlockStatus.Pending; } execInfo.StatusInfo.OtherStatusInfo = canSubmitInfo; }
public static void RegisterBlockForSubmit(int id, string blockName, object[] parms) { ReorgBlock execInfo = new ReorgBlock(id, blockName, parms, new BlockEndCallback(ReorgThreadEnd), Assembly.GetCallingAssembly()); string sValue; if (Config.GetValueOf("AppMainNamespace", out sValue)) { execInfo.AppNamespace = sValue; } if (!submitList.Contains(execInfo)) { lock (typeof(ReorgExecute)) { submitList.Add(execInfo); } } }
static ReorgBlockStatusInfo executeBlock(ReorgBlock execInfo) { execInfo.ExecuteBlock(); return(execInfo.StatusInfo); }