mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 14:25:44 +08:00
25 lines
389 B
C
25 lines
389 B
C
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
||
|
#pragma once
|
||
|
|
||
|
#include <atomic>
|
||
|
|
||
|
namespace Luau
|
||
|
{
|
||
|
|
||
|
struct FrontendCancellationToken
|
||
|
{
|
||
|
void cancel()
|
||
|
{
|
||
|
cancelled.store(true);
|
||
|
}
|
||
|
|
||
|
bool requested()
|
||
|
{
|
||
|
return cancelled.load();
|
||
|
}
|
||
|
|
||
|
std::atomic<bool> cancelled;
|
||
|
};
|
||
|
|
||
|
} // namespace Luau
|