In Thread A I want to wait for the value of some parameter in Thread B to be set to a certain value and if it doesn't happen in 10 seconds, the wait is terminated.

So, in Thread A I have a

WaitForSingleEvent(hevent, 10000);

The problem is how to use CreateEvent() in this case across two threads.

Thread B is an audio signal detection routine that is continuously running. The signal strength is continuously updated and placed in a variable 'signalstrength'.

Thread A is waiting to use the channel Thread B is monitoring, and it needs to wait until the signal strength drops below a certain value before using the channel.

So the event I want to wait upon is when 'signalstrength' drops below the threshold value.

Can this be done without defining a global 'hevent = CreateEvent()'? Thread B is implemented as an instance of a class object.

Thanks,

Brian Reinhold