Android-cuttlefish cvd tool
subprocess.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <chrono>
19#include <functional>
20#include <string>
21
23
24namespace gfxstream {
25
26// Runs the given function in a forked subprocess first to check for
27// aborts/crashes/etc and then runs the given function in the current
28// process if the subprocess check succeeded.
30 const std::function<gfxstream::expected<Ok, std::string>()>& function,
31 std::chrono::milliseconds timeout = std::chrono::seconds(15));
32
33} // namespace gfxstream
Definition: expected.h:33
Definition: egl.cpp:21
gfxstream::expected< Ok, std::string > DoWithSubprocessCheck(const std::function< gfxstream::expected< Ok, std::string >()> &function, std::chrono::milliseconds timeout)
Definition: subprocess.cpp:141