summaryrefslogtreecommitdiff
path: root/indra/llcorehttp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-05-21 20:06:41 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-06-03 21:31:30 +0300
commit823f97ac59e4eb11746cc38d330c223313a5a8fa (patch)
tree4ea1872388ebc12d99feecb4735462a81df0f12e /indra/llcorehttp
parent2922c593160f81d19f39d80fc84a25c2a0e0d8aa (diff)
SL-15272 Bugsplat crashes at condition wait()
Made sure all waits will be triggered, won't loop back and that in case of http queue it had some time to trigger
Diffstat (limited to 'indra/llcorehttp')
-rw-r--r--indra/llcorehttp/_httpreplyqueue.cpp1
-rw-r--r--indra/llcorehttp/_httpreplyqueue.h1
-rw-r--r--indra/llcorehttp/_httprequestqueue.cpp12
-rw-r--r--indra/llcorehttp/_httprequestqueue.h2
-rw-r--r--indra/llcorehttp/_httpservice.cpp6
5 files changed, 15 insertions, 7 deletions
diff --git a/indra/llcorehttp/_httpreplyqueue.cpp b/indra/llcorehttp/_httpreplyqueue.cpp
index 2b138f3ad5..229bfdbe07 100644
--- a/indra/llcorehttp/_httpreplyqueue.cpp
+++ b/indra/llcorehttp/_httpreplyqueue.cpp
@@ -56,7 +56,6 @@ void HttpReplyQueue::addOp(const HttpReplyQueue::opPtr_t &op)
mQueue.push_back(op);
}
- mQueueCV.notify_all();
}
diff --git a/indra/llcorehttp/_httpreplyqueue.h b/indra/llcorehttp/_httpreplyqueue.h
index 928ee10a83..33e205c1c9 100644
--- a/indra/llcorehttp/_httpreplyqueue.h
+++ b/indra/llcorehttp/_httpreplyqueue.h
@@ -98,7 +98,6 @@ protected:
OpContainer mQueue;
LLCoreInt::HttpMutex mQueueMutex;
- LLCoreInt::HttpConditionVariable mQueueCV;
}; // end class HttpReplyQueue
diff --git a/indra/llcorehttp/_httprequestqueue.cpp b/indra/llcorehttp/_httprequestqueue.cpp
index c6f4ad789f..ad72bdcce6 100644
--- a/indra/llcorehttp/_httprequestqueue.cpp
+++ b/indra/llcorehttp/_httprequestqueue.cpp
@@ -142,13 +142,19 @@ void HttpRequestQueue::wakeAll()
}
-void HttpRequestQueue::stopQueue()
+bool HttpRequestQueue::stopQueue()
{
{
HttpScopedLock lock(mQueueMutex);
- mQueueStopped = true;
- wakeAll();
+ if (!mQueueStopped)
+ {
+ mQueueStopped = true;
+ wakeAll();
+ return true;
+ }
+ wakeAll();
+ return false;
}
}
diff --git a/indra/llcorehttp/_httprequestqueue.h b/indra/llcorehttp/_httprequestqueue.h
index 3c3d134b07..f0296f30e3 100644
--- a/indra/llcorehttp/_httprequestqueue.h
+++ b/indra/llcorehttp/_httprequestqueue.h
@@ -124,7 +124,7 @@ public:
/// them on their way.
///
/// Threading: callable by any thread.
- void stopQueue();
+ bool stopQueue();
protected:
static HttpRequestQueue * sInstance;
diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp
index 34268d94f6..56f52f1b09 100644
--- a/indra/llcorehttp/_httpservice.cpp
+++ b/indra/llcorehttp/_httpservice.cpp
@@ -87,7 +87,11 @@ HttpService::~HttpService()
// is a bit tricky.
if (mRequestQueue)
{
- mRequestQueue->stopQueue();
+ if (mRequestQueue->stopQueue())
+ {
+ // Give mRequestQueue a chance to finish
+ ms_sleep(10);
+ }
}
if (mThread)