mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-07 18:03:34 +08:00
e5aa39dd35
* 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
30 lines
462 B
C++
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{};
|
|
}
|