/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v1.8.4
src/OneScript.DebugServices/MachineWaitToken.cs
33 строки
941 B
EvilBeaver
Поддержка признака terminateDebuggee
17 сен 2023, 09:08
17 сен 2023, 09:08
645b0e7
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using System; using System.Threading; using ScriptEngine.Machine; namespace OneScript.DebugServices { public class MachineWaitToken: IDisposable { private ManualResetEventSlim _threadEvent = new ManualResetEventSlim(); public MachineInstance Machine { get; set; } public void Wait() => _threadEvent.Wait(); public void Set() => _threadEvent.Set(); public void Reset() => _threadEvent.Reset(); public void Dispose() { Machine.UnsetDebugMode(); _threadEvent.Set(); _threadEvent.Dispose(); } } }