Basically, I have several classes that cause a static void that provides arguments (used in an ASP website) .
From my understanding, because void has its own stack, it is thread safe, however I'm not quite sure if this is true when outs are used. Can someone clarify the problem. Thanks!
namespace ThreadTest { class Program { static void Main(string[] args) { int helloWorldint = 0; bool helloWorldbool = false; int helloWorldintOut = 0; bool helloWorldboolOut = false; setHelloWorlds(helloWorldint, helloWorldbool, out helloWorldintOut, out helloWorldboolOut); Console.WriteLine(helloWorldintOut); Console.WriteLine(helloWorldboolOut); } public static void setHelloWorlds(int helloWorldint, bool helloWorldbool, out int helloWorldintOut, out bool helloWorldboolOut) { helloWorldintOut = helloWorldint + 1; helloWorldboolOut = true; } } }
user6445891
source share