mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
32 lines
677 B
C++
32 lines
677 B
C++
// Copyright 2015 The Chromium 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 "mojo/edk/system/test/simple_test_thread.h"
|
|
|
|
#include "base/logging.h"
|
|
|
|
namespace mojo {
|
|
namespace system {
|
|
namespace test {
|
|
|
|
SimpleTestThread::~SimpleTestThread() {
|
|
DCHECK(!thread_.joinable());
|
|
}
|
|
|
|
void SimpleTestThread::Start() {
|
|
DCHECK(!thread_.joinable());
|
|
thread_ = std::thread([this]() { Run(); });
|
|
}
|
|
|
|
void SimpleTestThread::Join() {
|
|
DCHECK(thread_.joinable());
|
|
thread_.join();
|
|
}
|
|
|
|
SimpleTestThread::SimpleTestThread() {}
|
|
|
|
} // namespace test
|
|
} // namespace system
|
|
} // namespace mojo
|