I have a thread that must wait until a condition is true or until a timer runs out and I was thinking which would be the best way to solve it, I though about condition variables but I am not sure if is the best method since I could have race condition, I would be happy to hear your suggestion.
Thank you.