TmpMenu/src/fiber_pool.hpp
maybegreat48 74ecf22ecf Menu revamp (#3274)
* Complete player and network UI redesign, meant to show all features instead of stuffing them into tiny boxes
* Added option to delete player vehicles
* Better clone player (now clones head blend too)
* Better host token spoofing, with an option to enter your own
* Better host token spoofing detection
* Better desync kick prot detections
* A script blocker for the entire session (per-player options will be added later)
* Added option to spoof data/DLC hashes
* Logging framework that allows developers to easily debug false positives
* Major protection improvements
2024-06-27 10:32:17 +02:00

31 lines
521 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 execute_on_game_thread(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{};
}