Skip to content
Snippets Groups Projects
Commit 21a87b52 authored by Joakim Skogø Langvand's avatar Joakim Skogø Langvand
Browse files

Add destructor

parent 68d549b8
No related branches found
No related tags found
No related merge requests found
/*
* Copyright (C) 2021 Joakim Skogø Langvand
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __WORKERS_HPP__
#define __WORKERS_HPP__
......@@ -32,9 +49,12 @@ namespace jlworkers {
std::thread m_runnerThread;
void stop();
public:
Workers();
Workers(int numThreads);
~Workers() { if (m_running) join(); }
void post(const std::function<void ()>&);
void post_timeout(const std::function<void ()>&, int timeout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment