This function takes the following parameter:
Condition variable on which to wait
NULL means block until notified. Otherwise, block until the time is up, then try again to acquire the lock.