From: chanywa Date: Mon, 11 Dec 2017 00:10:23 +0000 (+0900) Subject: Fix data race condition which is reported by Coverity X-Git-Tag: accepted/tizen/4.0/unified/20171211.061446^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d2580265be1fb9561233661148ec88cb6a12995;p=platform%2Fcore%2Flocation%2Fmaps-plugin-mapzen.git Fix data race condition which is reported by Coverity Change-Id: Ia42d4058ce4ff8221da9eb8dabb7c0b2c4ed63e7 --- diff --git a/src/mapzen/mapzen_restcurl.c b/src/mapzen/mapzen_restcurl.c index 3414298..470ae3d 100644 --- a/src/mapzen/mapzen_restcurl.c +++ b/src/mapzen/mapzen_restcurl.c @@ -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