1. A method comprising: exposing at least one function of a first application programming interface that, when invoked by a first thread of a process, receives from the first thread as parameters of the first application programming interface a target memory address, a current value observed by the first thread at the target memory address, a timeout value indicating when the first thread is to be woken up even if the value at the target memory address is not subsequently modified, and an indication of a portion of a value at the target memory address that is of interest to the first thread; checking, in response to the first application programming interface being invoked, whether the target memory address still has the current value observed by the first thread at the target memory address; returning, to the first thread, an indication to recheck the value at the target memory address in response to the target memory address not having the current value observed by the first thread at the target memory address; maintaining a record of the first thread and the target memory address, allowing the first thread to be identified in response to a value at the target memory address being subsequently modified; putting, in response to the first application programming interface being invoked, the first thread to sleep only if the target memory address still has the current value observed by the first thread at the target memory address; exposing at least one function of a second application programming interface that, when invoked by a second thread to indicate that a value at a memory address has been modified, receives from the second thread as a parameter of the second application programming interface the memory address that has been modified; checking whether the memory address received from the second thread matches the target memory address; determining whether at least the portion of the value at the target memory address that is of interest to the first thread has been modified; and waking up the first thread only if both the memory address received from the second thread matches the target memory address and at least the portion of the value at the target memory address that is of interest to the first thread has been modified.