I have following code:
Thread userThread = new Thread(() => UserPasswordSpawn.InputBox(ref userName, ref password));
//UserPassWordSpawn.InputBox(ref userName, ref password);
/* do some calculations while user puts in data */
userThread.Join();
The thread does not work, and never enters the InputBox() function (I set a breakpoint there, and it is never reached), while it works just fine if I do the commented part (but the calculations which should happen while the system is waiting for the user to input the data). How can I spawn a thread with 2 input parameters properly (twice ref string).
Note, the error I get is something about Thread.JoinInternal(), but the main thing is probably that the function is not called.
The call with the () => ThreadStart() I got from How to pass parameters to ThreadStart method in Thread?