I'm coding a C# app and I need to block processing in order to wait for an event.
If I use Thread.Sleep() the event is never triggered so I don't know what else to do.
This is my code (well, pseudo, as I don't have access to it right now):
Code:
bool dataArrived;
byte[] data;
void EventReceiveData()
{
data = //.. whatever
dataArrived = true;
}