I am trying to make a Windows version of a program written for Linux in C ++. To make the program thread safe, I use pthread_cond_t and pthread_cond_wait in the Linux version. These functions use mutexes to verify that the waiting thread is indeed waiting.
I found that CONDITION_VARIABLE can do the trick on Windows, however I cannot understand why it is not compiling. I get the error "error:" CONDITION_VARIABLE "does not name type", although all relevant headers are included, as far as I can tell. I tried copying the code to http://msdn.microsoft.com/en-us/library/ms686903%28v=VS.85%29.aspx , which also does not compile. I am using GCC.
Any ideas on how to compile this? or any alternative approaches that do not include variable_conditions?
source share