From 8942bd95385f6019a7ebfbeef7e1840412606be6 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 22 Jul 2015 13:17:28 +0900 Subject: Fixed thread handling in KDict. This resolsed bug 1748. Signed-off-by: Michele Calgaro --- kdict/dict.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'kdict/dict.h') diff --git a/kdict/dict.h b/kdict/dict.h index a4947c93..eb236fc2 100644 --- a/kdict/dict.h +++ b/kdict/dict.h @@ -1,9 +1,9 @@ /* ------------------------------------------------------------- - dict.h (part of The KDE Dictionary Client) + dict.h (part of The TDE Dictionary Client) Copyright (C) 2000-2001 Christian Gebauer - (C) by Matthias Hölzer 1998 + (C) by Matthias Hölzer 1998 This file is distributed under the Artistic License. See LICENSE for details. @@ -19,7 +19,7 @@ #ifndef _DICT_H_ #define _DICT_H_ -#include +#include #include #include @@ -95,22 +95,21 @@ public: //********* DictAsyncClient ****************************************** -class DictAsyncClient +class DictAsyncClient : public TQThread { - public: DictAsyncClient(int NfdPipeIn, int NfdPipeOut); ~DictAsyncClient(); - static void* startThread(void* pseudoThis); - + void run(); // main loop + void request_termination() { m_request_termination = true; } + void insertJob(JobData *newJob); void removeJob(); - + private: - void waitForWork(); // main loop void define(); bool getDefinitions(); bool match(); @@ -144,6 +143,7 @@ private: int fdPipeIn,fdPipeOut; //IPC-Pipes to/from async thread int tcpSocket,timeout,idleHold; TQTextCodec *codec; + bool m_request_termination; }; @@ -194,7 +194,6 @@ private: TQSocketNotifier *notifier; int fdPipeIn[2],fdPipeOut[2]; //IPC-Pipes to/from async thread - pthread_t threadID; DictAsyncClient *client; TQPtrList jobList; bool newServer,clientDoneInProgress; -- cgit v1.2.1