From: Jaroslav Kysela Date: Tue, 16 Jan 2018 09:47:32 +0000 (+0100) Subject: httpc: add 1 to tally atomically X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f23cda05dffe2143b06e21ac9f7335eefffdb81;p=thirdparty%2Ftvheadend.git httpc: add 1 to tally atomically --- 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;