From 4f23cda05dffe2143b06e21ac9f7335eefffdb81 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 16 Jan 2018 10:47:32 +0100 Subject: [PATCH] httpc: add 1 to tally atomically --- src/httpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/httpc.c b/src/httpc.c index e0afaaba0..ebf10e9bd 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -1552,7 +1552,7 @@ http_client_connect hc = calloc(1, sizeof(http_client_t)); pthread_mutex_init(&hc->hc_mutex, NULL); - hc->hc_id = ++tally; + hc->hc_id = atomic_add(&tally, 1); hc->hc_aux = aux; hc->hc_io_size = 1024; hc->hc_rtsp_stream_id = -1; -- 2.47.3