If UpdateImage
throws an exception, it is probably going to take down your whole process. Any thread that raises a top-level exception indicates a big problem. You should wrap this, for example by putting try
/catch
around UpdateImage
and doing something suitable. And yes, if an exception gets to the top of a thread, the thread is dead:
Thread t = new Thread(() => {
try {UpdateImage(origin); }
catch (Exception ex) {Trace.WriteLine(ex);}
});
t.Name = "UpdateImageThread";
t.Start();
(or your choice of error handling)