Fix data race condition which is reported by Coverity 66/163366/1 accepted/tizen_unified tizen accepted/tizen/unified/20171211.061320 submit/tizen/20171211.001637
authorchanywa <cbible.kim@samsung.com>
Mon, 11 Dec 2017 00:10:23 +0000 (09:10 +0900)
committerSeechan Kim <cbible.kim@samsung.com>
Mon, 11 Dec 2017 00:11:02 +0000 (00:11 +0000)
Change-Id: Ia42d4058ce4ff8221da9eb8dabb7c0b2c4ed63e7

src/mapzen/mapzen_restcurl.c

index 3414298506b764b4419200139e8b27acb74582ca..470ae3d1e76eec88f4da581590f8b94a275210b6 100644 (file)
@@ -599,8 +599,11 @@ int init_curl()
        __cm_handle = curl_multi_init();
        curl_multi_setopt(__cm_handle, CURLMOPT_MAXCONNECTS, (long)CURL_MAX_CONNECTS);
 
+       pthread_mutex_lock(&__curl_deliver_mutex);
        __MultiCurlArgsRemain = 0;
        __thread_running_for_curlmulti = true;
+       pthread_mutex_unlock(&__curl_deliver_mutex);
+
        int ret = pthread_create(&__CurlThread, NULL, &__curl_thread_handler, NULL);
 #endif