/* This function allow to do concurrent enumerations without the need to lock over the whole session, because the caller keep the context of the search. On the other hand, it might fail and return NULL if the entry is removed. - Jean II  */
void* hashbin_find_next(hashbin_t *hashbin, long hashv, const char *name, void **pnext)
/* This function allow to do concurrent enumerations without the need to lock over the whole session, because the caller keep the context of the search. On the other hand, it might fail and return NULL if the entry is removed. - Jean II  */
void* hashbin_find_next(hashbin_t *hashbin, long hashv, const char *name, void **pnext)
{
	unsigned long flags = 0;
	irda_queue_t* entry;
	spin_lock_irqsave(&hashbin->hb_spinlock, flags);
	entry = (irda_queue_t* ) hashbin_find( hashbin, hashv, name );
	if(entry) {
		hashbin->hb_current = entry;
		*pnext = hashbin_get_next( hashbin );
	} else
		*pnext = NULL;
	spin_unlock_irqrestore(&hashbin->hb_spinlock, flags);
	return entry;
}