chalk

kis_thread.h
1/*
2 * copyright (c) 2005 Boudewijn Rempt
3 *
4 * this program is free software; you can redistribute it and/or modify
5 * it under the terms of the gnu general public license as published by
6 * the free software foundation; either version 2 of the license, or
7 * (at your option) any later version.
8 *
9 * this program is distributed in the hope that it will be useful,
10 * but without any warranty; without even the implied warranty of
11 * merchantability or fitness for a particular purpose. see the
12 * gnu general public license for more details.
13 *
14 * you should have received a copy of the gnu general public license
15 * along with this program; if not, write to the free software
16 * foundation, inc., 675 mass ave, cambridge, ma 02139, usa.
17 */
18
19#ifndef KIS_THREAD_
20#define KIS_THREAD_
21
22#include <tqthread.h>
23#include <ksharedptr.h>
24
30class KisThread : public TQThread {
31
32public:
33
37 KisThread() : TQThread(), m_canceled(false) {};
38
45 virtual void cancel() { m_canceled = true; }
46 virtual bool isCanceled() { return m_canceled; }
47
48 void runDirectly() { run(); }
49
50protected:
51
52 bool m_canceled;
53
54};
55
56
57#endif
KisThread()
Create a new KisThread with the canceled state set to false.
Definition kis_thread.h:37
virtual void cancel()
Request the thread to cancel at the first opportunity.
Definition kis_thread.h:45