int valvula_hash_lock_until_changed ( ValvulaHash hash_table,
long  wait_microseconds 

Allows the callers to get locked until a change is detected on the hash table (insert, update or remove operation) found or the wait period is reached (wait_microseconds).

During the lock operation the hash table remains usable to other callers (including threads).

hash_tableThe hash table to wait for changes.
wait_microsecondsThe amount of time to wait. If 0 is used, it will wait without limit until next change is produced.
The function returns -2 in the case wrong parameters are received (NULL hash table reference or negative value for wait_microseconds). The function returns 0 in the case the wait_microseconds period is reached without any change. 1 is returned in the case a change is detected during the wait_microseconds. Once the function returns, the change has already taken place.

References valvula_async_queue_new(), valvula_async_queue_pop(), valvula_async_queue_timedpop(), valvula_hash_unref(), valvula_mutex_lock(), and valvula_mutex_unlock().