Changeset View
Changeset View
Standalone View
Standalone View
src/core/scheduler_p.h
Show All 19 Lines | |||||
20 | #define SCHEDULER_P_H | 20 | #define SCHEDULER_P_H | ||
21 | #include <QSet> | 21 | #include <QSet> | ||
22 | 22 | | |||
23 | // #define SCHEDULER_DEBUG | 23 | // #define SCHEDULER_DEBUG | ||
24 | 24 | | |||
25 | namespace KIO | 25 | namespace KIO | ||
26 | { | 26 | { | ||
27 | 27 | | |||
28 | // The slave keeper manages the list of idle slaves that can be reused | ||||
28 | class SlaveKeeper : public QObject | 29 | class SlaveKeeper : public QObject | ||
29 | { | 30 | { | ||
30 | Q_OBJECT | 31 | Q_OBJECT | ||
31 | public: | 32 | public: | ||
32 | SlaveKeeper(); | 33 | SlaveKeeper(); | ||
33 | ~SlaveKeeper(); | 34 | ~SlaveKeeper(); | ||
34 | void returnSlave(KIO::Slave *slave); | 35 | void returnSlave(KIO::Slave *slave); | ||
35 | // pick suitable slave for job and return it, return null if no slave found. | 36 | // pick suitable slave for job and return it, return null if no slave found. | ||
36 | // the slave is removed from the keeper. | 37 | // the slave is removed from the keeper. | ||
37 | KIO::Slave *takeSlaveForJob(KIO::SimpleJob *job); | 38 | KIO::Slave *takeSlaveForJob(KIO::SimpleJob *job); | ||
38 | // remove slave from keeper | 39 | // remove slave from keeper | ||
39 | bool removeSlave(KIO::Slave *slave); | 40 | bool removeSlave(KIO::Slave *slave); | ||
41 | // remove all slaves from keeper | ||||
42 | void clear(); | ||||
40 | QList<KIO::Slave *> allSlaves() const; | 43 | QList<KIO::Slave *> allSlaves() const; | ||
41 | 44 | | |||
42 | private: | 45 | private: | ||
43 | void scheduleGrimReaper(); | 46 | void scheduleGrimReaper(); | ||
44 | 47 | | |||
45 | private Q_SLOTS: | 48 | private Q_SLOTS: | ||
46 | void grimReaper(); | 49 | void grimReaper(); | ||
47 | 50 | | |||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |