mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
18 lines
464 B
C++
18 lines
464 B
C++
// Copyright 2017 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 "flutter/fml/thread_checker.h"
|
|
|
|
namespace fml {
|
|
|
|
ThreadChecker::ThreadChecker() : handle_(std::this_thread::get_id()) {}
|
|
|
|
ThreadChecker::~ThreadChecker() = default;
|
|
|
|
bool ThreadChecker::IsCalledOnValidThread() const {
|
|
return handle_ == std::this_thread::get_id();
|
|
}
|
|
|
|
} // namespace fml
|