C#C
C#3y ago
SWEETPONY

✅ Is it correct to use threads now?

I read in book following:
as soon as you type new Thread(), it`s over; your project already have legacy code

but what about this code:
LogForm? _logForm = null;
Thread shower = new Thread(() =>
{
   _logForm = new LogFrom(script, variables);
   Application.Run(_logForm);
});

shower.Start();

while (_logForm == null)
   Task.Delay(50).Wait();


is it correct? how to rewrite it so that it stops being legacy code?
Was this page helpful?