title: Waiting with timeout - Windows
body: <p>My program , in C++, has a thread that insets data to a buffer, and another thead that reads this data.
  when there is no more data to read, I wan to wait till the other thread inserts new data. 
  I mostly work on linux, but I dont know how to do it in Windows.
  the most similar thing that I've found is the "WaitForSingleObject" function, but it's not exactly what I need since I dont want to wail till the thread that inserts data is dead.</p>
  
  <p>can someone please direct me to a place I can read about this more?
  thanks!</p>