diff --git a/src/proto_http.c b/src/proto_http.c index 29b1b68d1..8ccbc2bcd 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -8364,7 +8364,7 @@ void http_reset_txn(struct stream *s) s->target = NULL; /* re-init store persistence */ s->store_count = 0; - s->uniq_id = global.req_count++; + s->uniq_id = HA_ATOMIC_XADD(&global.req_count, 1); s->req.flags |= CF_READ_DONTWAIT; /* one read is usually enough */ diff --git a/src/stream.c b/src/stream.c index 0f2ccf010..574c02f3d 100644 --- a/src/stream.c +++ b/src/stream.c @@ -152,7 +152,7 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin) s->si[0].flags = SI_FL_NONE; s->si[1].flags = SI_FL_ISBACK; - s->uniq_id = global.req_count++; + s->uniq_id = HA_ATOMIC_XADD(&global.req_count, 1); /* OK, we're keeping the stream, so let's properly initialize the stream */ LIST_INIT(&s->back_refs);