it does seem the user wants a conditional variable.

For locking I am guessing they want multithreading, each with an event loop.