I'm trying to translate some code written using windows functions for a Linux environment and I couldn't figure out what the equivalence of these are in Linux. My understanding of WaitForSingleObject
is that it waits for a flag and at the end of the function, ResetEvent
resets that flag.
The piece of code I'm working with is written as follows:
HANDLE someEvent;
WaitForSingleObject(someEvent, INFINITE);
{ some code }
ResetEvent(someEvent);
You are looking for pthread_cond_wait
Here's a link to a simple usage. You will see how both sides of the communication work.
Andres