新しいタスクを開始する関数があります。
private async Task GetCamera()
{
....
await Task.Run(async () => await MyAwesomeTask());//eternal cycle
int a=10;//how start without waiting for the end of the thread?
int b=15;
SomeFunction(a,b);
}
private async Task MyAwesomeTask()
{
while (true)
{
await Task.Delay(TimeSpan.FromSeconds(0.5));
//some task
}
}
ただし、次の行(int a = 10;)は、タスクが終了するまで待機します。(int a = 10;)待って、次に進む必要はありません。私は何をすべきか?