]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
httpc: add 1 to tally atomically
authorJaroslav Kysela <perex@perex.cz>
Tue, 16 Jan 2018 09:47:32 +0000 (10:47 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 16 Jan 2018 09:47:32 +0000 (10:47 +0100)
src/httpc.c

index e0afaaba0c730284fcc2a3bc10cc8c48dd0056e8..ebf10e9bdfb4a0adf8816e17d7342d21f451dbd0 100644 (file)
@@ -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;