Improve code quality

This commit is contained in:
halx99 2021-07-19 14:17:51 +08:00
parent fc768cbd3b
commit 04aa501cde
2 changed files with 4 additions and 1 deletions

View File

@ -368,6 +368,7 @@ void HttpClient::dispatchResponseCallbacks()
return;
auto lck = _finishedResponseQueue.get_lock();
CC_UNUSED(lck);
if (!_finishedResponseQueue.unsafe_empty())
{
HttpResponse* response = _finishedResponseQueue.front();
@ -419,11 +420,13 @@ void HttpClient::clearResponseQueue() {
void HttpClient::clearPendingResponseQueue()
{
auto lck = _pendingResponseQueue.get_lock();
CC_UNUSED(lck);
__clearQueueUnsafe(_pendingResponseQueue, ClearResponsePredicate{});
}
void HttpClient::clearFinishedResponseQueue() {
auto lck = _finishedResponseQueue.get_lock();
CC_UNUSED(lck);
__clearQueueUnsafe(_finishedResponseQueue, ClearResponsePredicate{});
}

View File

@ -123,7 +123,7 @@ public:
/**
* Send http request sync, will block caller thread until request finished.
* @remark You need call release manually after you don't want use the returned response
* @remark Caller must call release manually when the response never been used.
*/
HttpResponse* sendSync(HttpRequest* request);