mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-21 07:35:41 -04:00
Achievements: Drain outstanding requests when switching games
Stops data being lost when loading state due to data not being downloaded yet.
This commit is contained in:
@ -70,6 +70,12 @@ void HTTPDownloader::CreatePostRequest(std::string url, std::string post_data, R
|
||||
LockedAddRequest(req);
|
||||
}
|
||||
|
||||
bool HTTPDownloader::HasAnyRequests()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(m_pending_http_request_lock);
|
||||
return !m_pending_http_requests.empty();
|
||||
}
|
||||
|
||||
void HTTPDownloader::LockedPollRequests(std::unique_lock<std::mutex>& lock)
|
||||
{
|
||||
if (m_pending_http_requests.empty())
|
||||
|
@ -64,6 +64,8 @@ public:
|
||||
|
||||
void CreateRequest(std::string url, Request::Callback callback);
|
||||
void CreatePostRequest(std::string url, std::string post_data, Request::Callback callback);
|
||||
|
||||
bool HasAnyRequests();
|
||||
void PollRequests();
|
||||
void WaitForAllRequests();
|
||||
|
||||
|
Reference in New Issue
Block a user