}
while (1) {
- //HA_RWLOCK_RDLOCK(LOGSRV_LOCK, &ring->lock);
+ //HA_RWLOCK_RDLOCK(RING_LOCK, &ring->lock);
if (ofs >= buf.size) {
fprintf(stderr, "FATAL error at %d\n", __LINE__);
}
//HA_ATOMIC_INC(b_peek(&buf, ofs));
- //HA_RWLOCK_RDUNLOCK(LOGSRV_LOCK, &ring->lock);
+ //HA_RWLOCK_RDUNLOCK(RING_LOCK, &ring->lock);
if (!(flags & RING_WF_WAIT_MODE))
break;
* so that the dropped event arrives exactly at the right
* position.
*/
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &sink->ctx.lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &sink->ctx.lock);
sent = sink_announce_dropped(sink, facility);
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &sink->ctx.lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &sink->ctx.lock);
if (!sent) {
/* we failed, we don't try to send our log as if it
}
}
- HA_RWLOCK_RDLOCK(LOGSRV_LOCK, &sink->ctx.lock);
+ HA_RWLOCK_RDLOCK(RING_LOCK, &sink->ctx.lock);
sent = __sink_write(sink, maxlen, msg, nmsg, level, facility, metadata);
- HA_RWLOCK_RDUNLOCK(LOGSRV_LOCK, &sink->ctx.lock);
+ HA_RWLOCK_RDUNLOCK(RING_LOCK, &sink->ctx.lock);
fail:
if (unlikely(sent <= 0))
PIPES_LOCK,
TLSKEYS_REF_LOCK,
AUTH_LOCK,
- LOGSRV_LOCK,
+ RING_LOCK,
DICT_LOCK,
PROTO_LOCK,
QUEUE_LOCK,
if (!area)
return NULL;
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
/* recheck the buffer's size, it may have changed during the malloc */
if (b_size(&ring->buf) < size) {
ring->buf.size = size;
}
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
free(area);
return ring;
lenlen = varint_bytes(totlen);
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
if (lenlen + totlen + 1 + 1 > b_size(buf))
goto done_buf;
appctx_wakeup(appctx);
done_buf:
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
return sent;
}
if (!ring)
return;
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
if (ofs != ~0) {
/* reader was still attached */
if (ofs < b_head_ofs(&ring->buf))
HA_ATOMIC_DEC(b_peek(&ring->buf, ofs));
}
HA_ATOMIC_DEC(&ring->readers_count);
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
}
/* Tries to attach CLI handler <appctx> as a new reader on ring <ring>. This is
if (unlikely(sc_opposite(sc)->flags & SC_FL_SHUT_DONE))
return 1;
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
LIST_DEL_INIT(&appctx->wait_entry);
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
- HA_RWLOCK_RDLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_RDLOCK(RING_LOCK, &ring->lock);
/* explanation for the initialization below: it would be better to do
* this in the parsing function but this would occasionally result in
HA_ATOMIC_INC(b_peek(buf, ofs));
last_ofs = b_tail_ofs(buf);
ctx->ofs = b_peek_ofs(buf, ofs);
- HA_RWLOCK_RDUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_RDUNLOCK(RING_LOCK, &ring->lock);
if (ret && (ctx->flags & RING_WF_WAIT_MODE)) {
/* we've drained everything and are configured to wait for more
*/
if (!sc_oc(sc)->output && !(sc->flags & SC_FL_SHUT_DONE)) {
/* let's be woken up once new data arrive */
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
LIST_APPEND(&ring->waiters, &appctx->wait_entry);
ofs = b_tail_ofs(&ring->buf);
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
if (ofs != last_ofs) {
/* more data was added into the ring between the
* unlock and the lock, and the writer might not
goto close;
}
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
LIST_DEL_INIT(&appctx->wait_entry);
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
- HA_RWLOCK_RDLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_RDLOCK(RING_LOCK, &ring->lock);
/* explanation for the initialization below: it would be better to do
* this in the parsing function but this would occasionally result in
last_ofs = b_tail_ofs(buf);
sft->ofs = b_peek_ofs(buf, ofs);
- HA_RWLOCK_RDUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_RDUNLOCK(RING_LOCK, &ring->lock);
if (ret) {
/* let's be woken up once new data arrive */
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
LIST_APPEND(&ring->waiters, &appctx->wait_entry);
ofs = b_tail_ofs(buf);
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
if (ofs != last_ofs) {
/* more data was added into the ring between the
* unlock and the lock, and the writer might not
goto close;
}
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
LIST_DEL_INIT(&appctx->wait_entry);
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
- HA_RWLOCK_RDLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_RDLOCK(RING_LOCK, &ring->lock);
/* explanation for the initialization below: it would be better to do
* this in the parsing function but this would occasionally result in
HA_ATOMIC_INC(b_peek(buf, ofs));
sft->ofs = b_peek_ofs(buf, ofs);
- HA_RWLOCK_RDUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_RDUNLOCK(RING_LOCK, &ring->lock);
if (ret) {
/* let's be woken up once new data arrive */
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &ring->lock);
LIST_APPEND(&ring->waiters, &appctx->wait_entry);
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &ring->lock);
applet_have_no_more_data(appctx);
}
HA_SPIN_UNLOCK(SFT_LOCK, &sft->lock);
if (!sink)
return;
- HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &sink->ctx.ring->lock);
+ HA_RWLOCK_WRLOCK(RING_LOCK, &sink->ctx.ring->lock);
LIST_DEL_INIT(&sft->appctx->wait_entry);
- HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &sink->ctx.ring->lock);
+ HA_RWLOCK_WRUNLOCK(RING_LOCK, &sink->ctx.ring->lock);
sft->appctx = NULL;
task_wakeup(sink->forward_task, TASK_WOKEN_MSG);
case PIPES_LOCK: return "PIPES";
case TLSKEYS_REF_LOCK: return "TLSKEYS_REF";
case AUTH_LOCK: return "AUTH";
- case LOGSRV_LOCK: return "LOGSRV";
+ case RING_LOCK: return "RING";
case DICT_LOCK: return "DICT";
case PROTO_LOCK: return "PROTO";
case QUEUE_LOCK: return "QUEUE";