本文介绍了EventWaitHandle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想知道EventWaitHandle是否阻止其他事件的发生吗?

当我在主线程中调用eventWaitHandle.WaitOne()时,会发生我的问题,该语句会阻止主线程以及对我的第二个线程很重要的事件.我的第二个线程用于与控制器通信,并且始终处于while循环中以从控制器获取信息.我在此循环中的某个地方调用eventWaitHandle.Set().

我应该使用哪种方法?

谢谢您

Hi
I would like to know if EventWaitHandle blocks other events to happen?

My problem occurs when I call in main thread eventWaitHandle.WaitOne(), this statement blocks main thread and also events that are important for my second Thread. My second thread is for communicating with controller and is always in while loop to get information from controller. I call eventWaitHandle.Set() somewhere in this loop.

Wich method should i use?

THANK YOU

推荐答案


这篇关于EventWaitHandle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 10:53