new_pushed = 1;
if (locked)
- HA_RWLOCK_WRUNLOCK(STK_TABLE_LOCK, &st->table->lock);
-
- HA_RWLOCK_WRLOCK(STK_TABLE_LOCK, &st->table->lock);
+ HA_RWLOCK_WRTORD(STK_TABLE_LOCK, &st->table->lock);
+ else
+ HA_RWLOCK_RDLOCK(STK_TABLE_LOCK, &st->table->lock);
while (1) {
struct stksess *ts;
}
HA_ATOMIC_INC(&ts->ref_cnt);
- HA_RWLOCK_WRUNLOCK(STK_TABLE_LOCK, &st->table->lock);
+ HA_RWLOCK_RDUNLOCK(STK_TABLE_LOCK, &st->table->lock);
ret = peer_send_updatemsg(st, appctx, ts, updateid, new_pushed, use_timed);
- HA_RWLOCK_WRLOCK(STK_TABLE_LOCK, &st->table->lock);
+ HA_RWLOCK_RDLOCK(STK_TABLE_LOCK, &st->table->lock);
HA_ATOMIC_DEC(&ts->ref_cnt);
if (ret <= 0)
break;
}
out:
- HA_RWLOCK_WRUNLOCK(STK_TABLE_LOCK, &st->table->lock);
+ HA_RWLOCK_RDUNLOCK(STK_TABLE_LOCK, &st->table->lock);
if (locked)
HA_RWLOCK_WRLOCK(STK_TABLE_LOCK, &st->table->lock);