/*
 * cleaner.h
 *
 *  Created on: 05.02.2011
 *      Author: ed
 */

#ifndef CLEANER_H_
#define CLEANER_H_

#include "lockable.h"
#include <ctime>
#include <limits>

class cleaner : public condition
{
public:
	cleaner();
	virtual ~cleaner();
	void RunLatestAt(time_t when);

	void WorkLoop();
	void Stop();

private:
	time_t m_nextRun;
	pthread_t m_thr;
	bool m_bTerminating;
};

extern cleaner g_victor;

#endif /* CLEANER_H_ */
