The ring resizing was already quite tricky, but when facing atomic
writes it will no longer be possible and we definitely do not want to
have to deal with a lock there. Since it's only done at boot time, and
possibly later from the CLI, let's just do it under thread isolation.
if (!new)
return NULL;
- HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
+ thread_isolate();
/* recheck the buffer's size, it may have changed during the malloc */
/* new is now the old one */
}
- HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
+ thread_release();
/* free the unused one */
free(new);