if ( LEI(e)->lei_lruprev != NULL ) { \
LEI(LEI(e)->lei_lruprev)->lei_lrunext = LEI(e)->lei_lrunext; \
} else { \
- cache->c_lruhead = LEI(e)->lei_lrunext; \
+ (cache)->c_lruhead = LEI(e)->lei_lrunext; \
} \
if ( LEI(e)->lei_lrunext != NULL ) { \
LEI(LEI(e)->lei_lrunext)->lei_lruprev = LEI(e)->lei_lruprev; \
} else { \
- cache->c_lrutail = LEI(e)->lei_lruprev; \
+ (cache)->c_lrutail = LEI(e)->lei_lruprev; \
} \
} while(0)
#define LRU_ADD( cache, e ) do { \
- LEI(e)->lei_lrunext = cache->c_lruhead; \
+ LEI(e)->lei_lrunext = (cache)->c_lruhead; \
if ( LEI(e)->lei_lrunext != NULL ) { \
- LEI(LEI(e)->lei_lrunext)->lei_lruprev = e; \
+ LEI(LEI(e)->lei_lrunext)->lei_lruprev = (e); \
} \
- cache->c_lruhead = e; \
+ (cache)->c_lruhead = (e); \
LEI(e)->lei_lruprev = NULL; \
- if ( cache->c_lrutail == NULL ) { \
- cache->c_lrutail = e; \
+ if ( (cache)->c_lrutail == NULL ) { \
+ (cache)->c_lrutail = (e); \
} \
} while(0)
dn, id, state);
ldap_pvt_thread_yield();
-
goto try_again;
}
(AVL_CMP) entry_id_cmp )) != NULL )
{
int state;
+ ID ep_id;
+
count++;
assert( ep->e_private );
+ ep_id = ep->e_id;
state = LEI(ep)->lei_state;
/*
* entry is deleted or not fully created yet
*/
if ( state != CACHE_ENTRY_READY ) {
- ID ep_id = ep->e_id;
assert(state != CACHE_ENTRY_UNDEFINED);
/* free cache mutex */
ldap_pvt_thread_mutex_unlock( &cache->c_mutex );
+
+ Debug(LDAP_DEBUG_TRACE,
+ "====> cache_find_entry_id( %ld ): %ld (busy) %d\n",
+ id, ep_id, state);
+
ldap_pvt_thread_yield();
goto try_again;
}
Debug(LDAP_DEBUG_TRACE,
"====> cache_find_entry_id( %ld ) \"%s\" (found) (%d tries)\n",
- id, ep->e_dn, count);
+ ep_id, ep->e_dn, count);
return( ep );
}