mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Extract main thread run queue.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#ifndef __RUNQUEUE_HPP__
|
||||
#define __RUNQUEUE_HPP__
|
||||
|
||||
#include <functional>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
class RunQueue
|
||||
{
|
||||
public:
|
||||
RunQueue();
|
||||
|
||||
void Queue( std::function<void()> cb, bool forceDelay = false );
|
||||
void Run();
|
||||
|
||||
private:
|
||||
std::vector<std::function<void()>> m_queue;
|
||||
std::mutex m_lock;
|
||||
std::thread::id m_mainThread;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user