diff options
Diffstat (limited to 'indra/llmessage/llcurl.cpp')
-rw-r--r-- | indra/llmessage/llcurl.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 280a8942a8..330028c926 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -531,7 +531,7 @@ LLCurl::Multi::Multi() mThreaded = LLCurl::sMultiThreaded && LLThread::currentID() == sMainThreadID; if (mThreaded) { - mSignal = new LLCondition(); + mSignal = new LLCondition(NULL); } else { @@ -553,6 +553,11 @@ LLCurl::Multi::~Multi() { llassert(isStopped()); + if (LLCurl::sMultiThreaded) + { + LLCurl::Easy::sMultiMutex->lock(); + } + delete mSignal; mSignal = NULL; @@ -573,6 +578,11 @@ LLCurl::Multi::~Multi() check_curl_multi_code(curl_multi_cleanup(mCurlMultiHandle)); --gCurlMultiCount; + + if (LLCurl::sMultiThreaded) + { + LLCurl::Easy::sMultiMutex->unlock(); + } } CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue) @@ -1179,14 +1189,14 @@ void LLCurl::initClass(bool multi_threaded) check_curl_code(code); - Easy::sHandleMutex = new LLMutex(); - Easy::sMultiMutex = new LLMutex(); + Easy::sHandleMutex = new LLMutex(NULL); + Easy::sMultiMutex = new LLMutex(NULL); #if SAFE_SSL S32 mutex_count = CRYPTO_num_locks(); for (S32 i=0; i<mutex_count; i++) { - sSSLMutex.push_back(new LLMutex); + sSSLMutex.push_back(new LLMutex(NULL)); } CRYPTO_set_id_callback(&LLCurl::ssl_thread_id); CRYPTO_set_locking_callback(&LLCurl::ssl_locking_callback); |