summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-04-25 23:04:49 +0000
committerRobert Pösel <robyer@seznam.cz>2015-04-25 23:04:49 +0000
commit471161abf9be379a08c7e81598b4970effd5c59a (patch)
tree4b9ed846cb39c4caf1f8a30f00eb9a11a1c12169 /protocols
parentd77cfd0576c0818284c9cf10eedb8185339323d1 (diff)
Steam: More logging to understand reported freezing
git-svn-id: http://svn.miranda-ng.org/main/trunk@13155 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Steam/src/steam_queue.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/protocols/Steam/src/steam_queue.cpp b/protocols/Steam/src/steam_queue.cpp
index 6ef1aee6f7..6fe3f32f84 100644
--- a/protocols/Steam/src/steam_queue.cpp
+++ b/protocols/Steam/src/steam_queue.cpp
@@ -2,19 +2,29 @@
void CSteamProto::InitQueue()
{
+ debugLogA("%s: entering", __FUNCTION__);
+
InitializeCriticalSection(&requests_queue_lock);
m_evRequestsQueue = CreateEvent(NULL, FALSE, FALSE, NULL);
+
+ debugLogA("%s: leaving", __FUNCTION__);
}
void CSteamProto::UninitQueue()
{
+ debugLogA("%s: entering", __FUNCTION__);
+
requestsQueue.destroy();
CloseHandle(m_evRequestsQueue);
DeleteCriticalSection(&requests_queue_lock);
+
+ debugLogA("%s: leaving", __FUNCTION__);
}
void CSteamProto::StartQueue()
{
+ debugLogA("%s: entering", __FUNCTION__);
+
isTerminated = false;
if (m_hQueueThread == NULL)
@@ -39,15 +49,21 @@ void CSteamProto::StartQueue()
m_hQueueThread = ForkThreadEx(&CSteamProto::QueueThread, 0, NULL);
}
+
+ debugLogA("%s: leaving", __FUNCTION__);
}
void CSteamProto::StopQueue()
{
+ debugLogA("%s: entering", __FUNCTION__);
+
isTerminated = true;
{
mir_cslock lock(requests_queue_lock);
+ debugLogA("%s: requestsQueue contains %d items", __FUNCTION__, requestsQueue.getCount());
+
while (requestsQueue.getCount() > 0)
{
QueueItem *item = requestsQueue[0];
@@ -55,6 +71,8 @@ void CSteamProto::StopQueue()
// QueueItem's destructor properly free request and arg
delete item;
+
+ debugLogA("%s: removed item from requestsQueue, %d items remaining", __FUNCTION__, requestsQueue.getCount());
}
}
@@ -68,6 +86,8 @@ void CSteamProto::StopQueue()
delete request;
m_hQueueThread = NULL;
+
+ debugLogA("%s: leaving", __FUNCTION__);
}
void CSteamProto::PushRequest(SteamWebApi::HttpRequest *request)
@@ -82,6 +102,8 @@ void CSteamProto::PushRequest(SteamWebApi::HttpRequest *request, RESPONSE respon
void CSteamProto::PushRequest(SteamWebApi::HttpRequest *request, RESPONSE response, void *arg, ARG_FREE_TYPE arg_free_type)
{
+ debugLogA("%s: entering", __FUNCTION__);
+
// Always prepare QueueItem so we can use it's destructor to free request and arg
QueueItem *item = new QueueItem(request, response);
item->arg = arg;
@@ -89,6 +111,8 @@ void CSteamProto::PushRequest(SteamWebApi::HttpRequest *request, RESPONSE respon
if (isTerminated)
{
+ debugLogA("%s: leaving (isTerminated)", __FUNCTION__);
+
// QueueItem's destructor properly free request and arg
delete item;
return;
@@ -100,12 +124,18 @@ void CSteamProto::PushRequest(SteamWebApi::HttpRequest *request, RESPONSE respon
}
SetEvent(m_evRequestsQueue);
+
+ debugLogA("%s: leaving", __FUNCTION__);
}
void CSteamProto::ExecuteRequest(QueueItem *item)
{
+ debugLogA("%s: entering", __FUNCTION__);
+
if (isTerminated)
{
+ debugLogA("%s: leaving (isTerminated)", __FUNCTION__);
+
// QueueItem's destructor properly free request and arg
delete item;
return;
@@ -127,11 +157,13 @@ void CSteamProto::ExecuteRequest(QueueItem *item)
}*/
delete item;
+
+ debugLogA("%s: leaving", __FUNCTION__);
}
void CSteamProto::QueueThread(void*)
{
- debugLog(_T("CSteamProto::QueueThread: entering"));
+ debugLogA("%s: entering", __FUNCTION__);
while (!isTerminated)
{
@@ -156,5 +188,5 @@ void CSteamProto::QueueThread(void*)
}
}
- debugLog(_T("CSteamProto::QueueThread: leaving"));
+ debugLogA("%s: leaving", __FUNCTION__);
} \ No newline at end of file