summaryrefslogtreecommitdiffstats
path: root/kdict/dict.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2015-07-22 13:17:28 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2015-08-26 23:08:46 +0900
commitc016e4809df23ff5a7c9e8aee4826b1e3ecd5b20 (patch)
tree293a2d6d60c2824a598f58f975160353e10a26d2 /kdict/dict.h
parent1da54d8c259178905007ddd1979d53a9e5901cb2 (diff)
downloadtdenetwork-c016e4809df23ff5a7c9e8aee4826b1e3ecd5b20.tar.gz
tdenetwork-c016e4809df23ff5a7c9e8aee4826b1e3ecd5b20.zip
Fixed thread handling in KDict. This resolsed bug 1748.
(cherry picked from commit 8942bd95385f6019a7ebfbeef7e1840412606be6) Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kdict/dict.h')
-rw-r--r--kdict/dict.h19
1 files changed, 9 insertions, 10 deletions
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 <gebauer@kde.org>
- (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 <pthread.h>
+#include <ntqthread.h>
#include <tqptrlist.h>
#include <tqsocketnotifier.h>
@@ -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<JobData> jobList;
bool newServer,clientDoneInProgress;