effil/src/cpp/this_thread.h
mihacooper 1b0c968bf5
Interruption points in sync operations (get, wait, pop, ...) (#118)
Interruption points in sync operations (get, wait, pop, ...)
2022-04-17 19:46:25 +03:00

26 lines
434 B
C++

#pragma once
#include <sol.hpp>
namespace effil {
struct IInterruptable;
namespace this_thread {
class ScopedSetInterruptable
{
public:
ScopedSetInterruptable(IInterruptable* notifier);
~ScopedSetInterruptable();
};
void interruptionPoint();
// Lua API
std::string threadId();
void yield();
void sleep(const sol::stack_object& duration, const sol::stack_object& metric);
} // namespace this_thread
} // namespace effil