TimerPool fixoutManipulator

git-svn-id: svn://db.shs.com.ru/pip@70 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-07 10:47:59 +00:00
parent ca33c89d95
commit edd3d5f354
3 changed files with 9 additions and 4 deletions

View File

@@ -152,7 +152,7 @@ bool PIBaseTransfer::send_process() {
state_string = "sending";
PITimeMeasurer stm;
send_tm.reset();
int ltm = 0;
//int ltm = 0;
for (int i = 0; i < session.size_s(); i++) {
if (send_queue >= packets_count) {
--i;

View File

@@ -309,8 +309,10 @@ _PITimerImp_Pool::Pool * _PITimerImp_Pool::Pool::instance() {
void _PITimerImp_Pool::Pool::add(_PITimerImp_Pool * t) {
//piCout << "add ...";
lock();
if (!timers.contains(t))
if (!timers.contains(t)) {
timers << t;
to_remove.removeOne(t);
}
unlock();
//piCout << "add done";
}
@@ -319,7 +321,7 @@ void _PITimerImp_Pool::Pool::add(_PITimerImp_Pool * t) {
void _PITimerImp_Pool::Pool::remove(_PITimerImp_Pool * t) {
//piCout << "remove ...";
lock();
timers.removeOne(t);
to_remove.removeOne(t);
unlock();
//piCout << "remove done";
}
@@ -328,6 +330,9 @@ void _PITimerImp_Pool::Pool::remove(_PITimerImp_Pool * t) {
void _PITimerImp_Pool::Pool::run() {
piForeach (_PITimerImp_Pool * t, timers)
t->threadFunc();
piForeach (_PITimerImp_Pool * t, to_remove)
timers.removeOne(t);
to_remove.clear();
//while (t->threadFunc());
}

View File

@@ -120,7 +120,7 @@ private:
void add(_PITimerImp_Pool * t);
void remove(_PITimerImp_Pool * t);
void run();
PIVector<_PITimerImp_Pool * > timers;
PIVector<_PITimerImp_Pool * > timers, to_remove;
};
virtual bool startTimer(double interval_ms);
virtual bool stopTimer();