Preliminary condition variable implementation