A value from one thread influencing the path of another thread

后端 未结 2 1819
[愿得一人]
[愿得一人] 2020-12-04 03:33

I have a program which uses two client threads and a server. There is a point in my program where I want a value in one thread to influence the path of another thread.

2条回答
  •  心在旅途
    2020-12-04 04:11

    In response to Luaan's comment. I have put the endGameTrigger as private static string endGameTrigger in the Handler class. Making it a static field instead of a local method variable allows all instances of the handler class (each thread) access to this variable's most recent assignation. Many thanks.

提交回复
热议问题