~ubuntu-branches/ubuntu/maverick/newsbeuter/maverick

« back to all changes in this revision

Viewing changes to src/reloadthread.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Nico Golde
  • Date: 2007-04-21 19:44:35 UTC
  • Revision ID: james.westby@ubuntu.com-20070421194435-21g6134ws2yvarlt
Tags: upstream-0.3
ImportĀ upstreamĀ versionĀ 0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <reloadthread.h>
 
2
#include <logger.h>
 
3
 
 
4
using namespace newsbeuter;
 
5
 
 
6
reloadthread::reloadthread(controller * c, unsigned int wt_sec) : ctrl(c), oldtime(0), waittime_sec(wt_sec) {
 
7
        GetLogger().log(LOG_INFO,"reloadthread: waiting %u seconds between reloads",waittime_sec);
 
8
}
 
9
 
 
10
reloadthread::~reloadthread() { }
 
11
 
 
12
void reloadthread::run() {
 
13
        for (;;) {
 
14
                oldtime = time(NULL);
 
15
                GetLogger().log(LOG_INFO,"reloadthread: starting reload");
 
16
                ctrl->start_reload_all_thread();
 
17
                ::sleep((oldtime + waittime_sec) - time(NULL));
 
18
        }
 
19
}