A private doorbell project to serve an Android app with webcam pictures and microphone recordings when someone presses the button. Information is being spread via MQTT. https://www.taibsu.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
heimdall/threadLauncher.h

33 lines
553 B

#ifndef THREADLAUNCHER_H
#define THREADLAUNCHER_H
#include <vector>
#include <thread>
#include <functional>
namespace tai
{
class threadLauncher
{
public:
void go(const std::string& shellCmd);
void go(std::unique_ptr<std::thread> thread);
auto execShellCmd(std::string const& cmd) -> std::string;
void closeAllThreads();
static threadLauncher& inst()
{
static threadLauncher inst;
return inst;
}
private:
threadLauncher() {}
~threadLauncher();
std::vector<std::unique_ptr<std::thread>> _asyncThreads;
};
}
#endif // THREADLAUNCHER_H