Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
6. 退出沙盒
根据您运行沙盒的方式(请参阅此步骤),您必须调整终止沙盒的方式,从而也调整终止 Sandboxee 的方式。
退出同步运行的沙盒
如果沙盒以同步方式运行,则 Run 仅在 Sandboxee 完成时返回。因此,无需执行额外的终止步骤。以下代码段展示了此情形:
Sandbox2::Result result = s2.Run();
LOG(INFO) << "Final execution status: " << result.ToString();
异步退出正在运行的沙盒
如果沙盒以异步方式运行,则有两种终止方式。首先,您可以等待 Sandboxee 完成,并接收最终的执行状态:
sandbox2::Result result = s2.AwaitResult();
LOG(INFO) << "Final execution status: " << result.ToString();
或者,您也可以随时终止 Sandboxee,但仍建议调用 AwaitResult(),因为 Sandboxee 可能会因其他原因而终止:
s2.Kill();
sandbox2::Result result = s2.AwaitResult();
LOG(INFO) << "Final execution status: " << result.ToString();
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-26。"],[],[]]