summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/request_queue.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-03 16:02:14 +0200
committerGeorge Hazan <ghazan@miranda.im>2018-05-03 16:02:14 +0200
commit3ad2582c4a4a6378f294f9256ecbcbdf0ae88e3a (patch)
tree412a28ef6a572efc7039df1c363bf47a3dec4b19 /protocols/SkypeWeb/src/request_queue.cpp
parent9a6f750a482d1d1ebf4281bb7bf8133e547ad438 (diff)
mir_forkThread<typename> - stronger typizatioin for thread function parameter
Diffstat (limited to 'protocols/SkypeWeb/src/request_queue.cpp')
-rw-r--r--protocols/SkypeWeb/src/request_queue.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/protocols/SkypeWeb/src/request_queue.cpp b/protocols/SkypeWeb/src/request_queue.cpp
index 6ed47aa00c..ed64a40447 100644
--- a/protocols/SkypeWeb/src/request_queue.cpp
+++ b/protocols/SkypeWeb/src/request_queue.cpp
@@ -41,7 +41,7 @@ void RequestQueue::Start()
isTerminated = false;
if (hRequestQueueThread == nullptr)
- hRequestQueueThread = mir_forkthread((pThreadFunc)&RequestQueue::WorkerThread, this);
+ hRequestQueueThread = mir_forkThread<RequestQueue>(&RequestQueue::WorkerThread, this);
}
void RequestQueue::Stop()
@@ -70,7 +70,7 @@ void RequestQueue::Push(HttpRequest *request, HttpResponseCallback response, voi
void RequestQueue::Send(HttpRequest *request, HttpResponseCallback response, void *arg)
{
RequestQueueItem *item = new RequestQueueItem(request, response, arg);
- mir_forkthreadowner((pThreadFuncOwner)&RequestQueue::AsyncSendThread, this, item, nullptr);
+ mir_forkthreadowner(&RequestQueue::AsyncSendThread, this, item, nullptr);
}
void RequestQueue::Execute(RequestQueueItem *item)
@@ -83,20 +83,17 @@ void RequestQueue::Execute(RequestQueueItem *item)
delete item;
}
-unsigned int RequestQueue::AsyncSendThread(void *owner, void *arg)
+unsigned RequestQueue::AsyncSendThread(void *owner, void *arg)
{
RequestQueue *that = (RequestQueue*)owner;
RequestQueueItem *item = (RequestQueueItem*)arg;
that->Execute(item);
-
return 0;
}
-unsigned int RequestQueue::WorkerThread(void *arg)
+void RequestQueue::WorkerThread(RequestQueue *queue)
{
- RequestQueue *queue = (RequestQueue*)arg;
-
while (true) {
queue->hRequestQueueEvent.Wait();
if (queue->isTerminated)
@@ -119,5 +116,4 @@ unsigned int RequestQueue::WorkerThread(void *arg)
}
queue->hRequestQueueThread = nullptr;
- return 0;
-} \ No newline at end of file
+}