I tried to initialize a Thread that has the function of processing a certain information by a method, so that the main execution line of the program keeps running. But I need to pass two values to this method. The fragment of the method that will be pointed to in Thread can be seen below.
public class Dados
{
public void Processamento(ulong address, string line)
{
string[] data = line.Split('||');
//...
radio.SendAndWaitForResponse(address,information);
...
}
}
The Thread would be instantiated as follows:
int index = 0;
ulong addr = 0x00;
string line = "";
//...
public List<Dados> Data new List<Dados>();
public List<Thread> Processos = new List<Thread>();
//...
Processos.Add(new Thread(Data[index].Processamento))
Processos[index].Start();
index++;
That's where my method was:
public void Processamento() { ... }
But I wish I could pass the value of the addr
and line
variables when instantiating the Thread, as if it were to use the method normally. p>
Processamento(addr, line);