public void Good1() { CWE366_Race_Condition_within_a_Thread__Global_Variable_01 goodInst = new CWE366_Race_Condition_within_a_Thread__Global_Variable_01(); Thread worker1 = new Thread(goodInst.Work_Good); Thread worker2 = new Thread(goodInst.Work_Good); Thread worker3 = new Thread(goodInst.Work_Good); worker1.Start(); worker2.Start(); worker3.Start(); IO.WriteLine(goodInst.result); }
public override void Bad() { CWE366_Race_Condition_within_a_Thread__Global_Variable_01 badInst = new CWE366_Race_Condition_within_a_Thread__Global_Variable_01(); Thread worker1 = new Thread(badInst.Work_Bad); Thread worker2 = new Thread(badInst.Work_Bad); Thread worker3 = new Thread(badInst.Work_Bad); worker1.Start(); worker2.Start(); worker3.Start(); IO.WriteLine(badInst.result); }