blob: 876a08e38ce676bbd9d5f4c63c57e721a27a76d9 [file] [log] [blame]
henrik.lundin@webrtc.org1e3c5c22014-06-16 11:34:44 +00001/*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11// Borrowed from Chromium's src/base/threading/thread_checker.h.
12
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#ifndef RTC_BASE_THREAD_CHECKER_H_
14#define RTC_BASE_THREAD_CHECKER_H_
henrik.lundin@webrtc.org1e3c5c22014-06-16 11:34:44 +000015
Sebastian Janssonc01367d2019-04-08 15:20:44 +020016#include "rtc_base/deprecation.h"
Sebastian Janssondf5e4e02019-03-29 10:34:45 +010017#include "rtc_base/synchronization/sequence_checker.h"
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020018
19namespace rtc {
Sebastian Janssondf5e4e02019-03-29 10:34:45 +010020// TODO(srte): Replace usages of this with SequenceChecker.
21class ThreadChecker : public webrtc::SequenceChecker {
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020022 public:
Sebastian Janssonc01367d2019-04-08 15:20:44 +020023 RTC_DEPRECATED bool CalledOnValidThread() const { return IsCurrent(); }
24 RTC_DEPRECATED void DetachFromThread() { Detach(); }
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020025};
Henrik Kjellanderec78f1c2017-06-29 07:52:50 +020026} // namespace rtc
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020027#endif // RTC_BASE_THREAD_CHECKER_H_