public static async Task Up() { AsyncLock mutex = new AsyncLock(); if (await HeartbeatCheck()) return; while (true) { using (await mutex.LockAsync()) { if (_server == null || _server._process == null || _server._process.HasExited) _server = new NodeServer(); } using (Task task = Task.Delay(200)) { await task.ConfigureAwait(false); if (await HeartbeatCheck()) break; } } }
internal Releaser(AsyncLock toRelease) { m_toRelease = toRelease; }