mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-20 01:21:26 +01:00
CLEANUP: patterns: remove dead code
Situations where we are iterating over elements and find one with a different generation ID cannot arise anymore since the elements are kept per-generation.
This commit is contained in:
parent
545cf59b6f
commit
99e625a41d
@ -3047,7 +3047,6 @@ static int _hlua_listable_patref_pairs_iterator(lua_State *L, int status, lua_KC
|
||||
int context_index;
|
||||
struct hlua_patref_iterator_context *hctx;
|
||||
struct pat_ref_elt *elt;
|
||||
int cnt = 0;
|
||||
unsigned int curr_gen;
|
||||
|
||||
context_index = lua_upvalueindex(1);
|
||||
@ -3078,23 +3077,6 @@ static int _hlua_listable_patref_pairs_iterator(lua_State *L, int status, lua_KC
|
||||
|
||||
elt = LIST_ELEM(hctx->bref.ref, struct pat_ref_elt *, list);
|
||||
|
||||
if (elt->gen_id != curr_gen) {
|
||||
/* check if we may do something to try to prevent thread contention,
|
||||
* unless we run from body/init state where hlua_yieldk is no-op
|
||||
*/
|
||||
if (cnt > 10000 && hlua_gethlua(L)) {
|
||||
/* let's yield and wait for being called again to continue where we left off */
|
||||
LIST_APPEND(&elt->back_refs, &hctx->bref.users);
|
||||
HA_RWLOCK_WRUNLOCK(PATREF_LOCK, &hctx->ref->ptr->lock);
|
||||
hlua_yieldk(L, 0, 0, _hlua_listable_patref_pairs_iterator, TICK_ETERNITY, HLUA_CTRLYIELD); // continue
|
||||
return 0; // not reached
|
||||
}
|
||||
|
||||
hctx->bref.ref = elt->list.n;
|
||||
cnt++;
|
||||
goto next;
|
||||
}
|
||||
|
||||
LIST_APPEND(&elt->back_refs, &hctx->bref.users);
|
||||
HA_RWLOCK_WRUNLOCK(PATREF_LOCK, &hctx->ref->ptr->lock);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user