/* Entries may not be inserted to @hash_table, nor may @hash_table be destroyed by code executed from @hash_callback. The relevant functions will halt in these cases.  */
void _cairo_hash_table_foreach(cairo_hash_table_t *hash_table, cairo_hash_callback_func_t hash_callback, void *closure)
/* Entries may not be inserted to @hash_table, nor may @hash_table be destroyed by code executed from @hash_callback. The relevant functions will halt in these cases.  */
void _cairo_hash_table_foreach(cairo_hash_table_t *hash_table, cairo_hash_callback_func_t hash_callback, void *closure)
{
    unsigned long i;
    cairo_hash_entry_t *entry;
    ++hash_table->iterating;
    for (i = 0; i < *hash_table->table_size; i++) {
	entry = hash_table->entries[i];
	if (ENTRY_IS_LIVE(entry))
	    hash_callback (entry, closure);
    }
    if (--hash_table->iterating == 0) {
	_cairo_hash_table_manage (hash_table);
    }
}