TmpMenu/src/fiber_pool.hpp
maybegreat48 e5aa39dd35 Play audio on voice chat and more (#1053)
* feat(VC): audio through voice chat
* fix(BlackHole): remove unnecessary cleanup
* fix(Formatting): fix formatting for initializer lists
* feat(LSC): reimplement LSC
* feat(Protections): add (untested) protections for vehicle kick and remote teleport
2023-03-09 12:23:01 +00:00

30 lines
462 B
C++

#pragma once
#include "common.hpp"
namespace big
{
class fiber_pool
{
public:
explicit fiber_pool(std::size_t num_fibers);
~fiber_pool();
void queue_job(std::function<void()> func);
void fiber_tick();
static void fiber_func();
int get_total_fibers();
int get_used_fibers();
void reset();
private:
std::recursive_mutex m_mutex;
std::stack<std::function<void()>> m_jobs;
int m_num_fibers;
};
inline fiber_pool* g_fiber_pool{};
}