There is an elegant solution based on the
ThreadWrapper I presented in my past answers:
How to pass ref parameter to the thread[
^],
Change parameters of thread (producer) after it is started[
^],
MultiThreading in C#[
^].
The idea is based on the fact that thread start method could be either static or instance method (not-static). In case of instance method, it could be the wrapper instance method. This way, you can pass all parameters as wrapper properties and even conveniently encapsulate thred synchronizatoin, so the caller won't need to be conserned with synchronizatoin.
CodeProject member was so nice to provide a VB.NET version:
Passing arguments to a threaded LongRunningProcess[
^].
However, I covered more important techniques in my answers. If you want, you can easily translate my C# samples into VB.NET automatically. I explained how to do it in my past answers. Please see:
FixedPage to ContentPage convert c# code into vb.net[
^],
Need to convert vb code to c#[
^].
[EDIT]
After OP's clarification of the problem.
For better understanding, please see my comments on
Thread.Abort
and my past answers where I tried to explain its non-trivial mechanism:
Close correcly the thread inside a dll[
^],
Problem with creating Process from dedicated thread[
^].
Good luck,
—SA