summaryrefslogtreecommitdiff
path: root/src/downloadthread.cpp
blob: 1c4b53df934e2abaed8c2bf8e7c815615a18737d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <downloadthread.h>
#include <logger.h>

namespace newsbeuter
{

downloadthread::downloadthread(controller * c) : ctrl(c) {
}

downloadthread::~downloadthread() {
}

void downloadthread::run() {
	/*
	 * the downloadthread class drives the reload-all process.
	 * A downloadthread is spawned whenever "reload all" is invoked, and whenever an auto-reload
	 * comes up.
	 */
	GetLogger().log(LOG_DEBUG, "downloadthread::run: inside downloadthread, reloading all feeds...");
	if (ctrl->trylock_reload_mutex()) {
		ctrl->reload_all();
		ctrl->unlock_reload_mutex();
	}
	this->detach();
}

}