Fix data race condition which is reported by Coverity 64/163364/1 accepted/tizen_4.0_unified tizen_4.0 accepted/tizen/4.0/unified/20171211.061446 submit/tizen_4.0/20171211.001622
authorchanywa <cbible.kim@samsung.com>
Mon, 11 Dec 2017 00:10:23 +0000 (09:10 +0900)
committerchanywa <cbible.kim@samsung.com>
Mon, 11 Dec 2017 00:10:23 +0000 (09:10 +0900)
Change-Id: Ia42d4058ce4ff8221da9eb8dabb7c0b2c4ed63e7

src/mapzen/mapzen_restcurl.c

index 3414298..470ae3d 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