thread with multiple parameters

前端 未结 11 1608
一生所求
一生所求 2020-11-29 04:16

Does anyone know how to pass multiple parameters into a Thread.Start routine?

I thought of extending the class, but the C# Thread class is sealed.

Here is wh

11条回答
  •  庸人自扰
    2020-11-29 05:12

    Try using a lambda expression to capture the arguments.

    Thread standardTCPServerThread = 
      new Thread(
        unused => startSocketServerAsThread(initializeMemberBalance, arg, 60000)
      );
    

提交回复
热议问题