6#include "phosphorscripting_export.h"
10#include <condition_variable>
15#include <unordered_map>
47 void registerFlag(
const void* key, std::shared_ptr<std::atomic<bool>> flag);
54 void arm(
const void* key,
int timeoutMs);
62 std::shared_ptr<std::atomic<bool>> flag;
63 std::chrono::steady_clock::time_point deadline = std::chrono::steady_clock::time_point::max();
64 uint64_t generation = 0;
69 std::unordered_map<const void*, Entry> m_entries;
72 std::condition_variable m_cv;
73 bool m_shutdown =
false;
void registerFlag(const void *key, std::shared_ptr< std::atomic< bool > > flag)
Register key's interrupt flag. Idempotent; replaces an existing flag.
void disarm(const void *key)
Cancel key's pending deadline.
LuauWatchdog(const LuauWatchdog &)=delete
void arm(const void *key, int timeoutMs)
Start a timeoutMs deadline for key.
LuauWatchdog & operator=(const LuauWatchdog &)=delete
void unregister(const void *key)
Remove key entirely. Safe to call from the engine destructor.
Definition LuauEngine.h:19