blob: dd4c91aa95725914a28b4b0ad7505bd866bb01f5 [file] [log] [blame]
// 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