From 3ad2582c4a4a6378f294f9256ecbcbdf0ae88e3a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 3 May 2018 16:02:14 +0200 Subject: mir_forkThread - stronger typizatioin for thread function parameter --- protocols/SkypeWeb/src/request_queue.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'protocols/SkypeWeb/src/request_queue.cpp') 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::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 +} -- cgit v1.2.3