mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
58e84c8bf0
* Re-land "Support multiple shells in a single process. (#4932)"
This reverts commit 723c7d0143.
39 lines
977 B
C++
39 lines
977 B
C++
// Copyright 2017 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "flutter/shell/common/thread_host.h"
|
|
|
|
namespace shell {
|
|
|
|
ThreadHost::ThreadHost() = default;
|
|
|
|
ThreadHost::ThreadHost(std::string name_prefix, uint64_t mask) {
|
|
if (mask & ThreadHost::Type::Platform) {
|
|
platform_thread = std::make_unique<fml::Thread>(name_prefix + ".platform");
|
|
}
|
|
|
|
if (mask & ThreadHost::Type::UI) {
|
|
ui_thread = std::make_unique<fml::Thread>(name_prefix + ".ui");
|
|
}
|
|
|
|
if (mask & ThreadHost::Type::GPU) {
|
|
gpu_thread = std::make_unique<fml::Thread>(name_prefix + ".gpu");
|
|
}
|
|
|
|
if (mask & ThreadHost::Type::IO) {
|
|
io_thread = std::make_unique<fml::Thread>(name_prefix + ".io");
|
|
}
|
|
}
|
|
|
|
ThreadHost::~ThreadHost() = default;
|
|
|
|
void ThreadHost::Reset() {
|
|
platform_thread.reset();
|
|
ui_thread.reset();
|
|
gpu_thread.reset();
|
|
io_thread.reset();
|
|
}
|
|
|
|
} // namespace shell
|