webrtc_m130/rtc_base/system/cocoa_threading.mm
Boris Tsirkin 5654f891bb Format /rtc_base folder
Formatting done via:

git ls-files | grep -E '^rtc_base\/.*\.(h|cc|mm)' | xargs clang-format -i

No-Iwyu: Includes didn't change and it isn't related to formatting
Bug: webrtc:42225392
Change-Id: I11c1ae6d6ea49c744a4e60a1a032e3d5ae7bce1f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373906
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43688}
2025-01-08 11:20:49 -08:00

27 lines
931 B
Plaintext

/*
* Copyright 2018 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "rtc_base/system/cocoa_threading.h"
#import <Foundation/Foundation.h>
#include "rtc_base/checks.h"
void InitCocoaMultiThreading() {
static BOOL is_cocoa_multithreaded = [NSThread isMultiThreaded];
if (!is_cocoa_multithreaded) {
// +[NSObject class] is idempotent.
[NSThread detachNewThreadSelector:@selector(class)
toTarget:[NSObject class]
withObject:nil];
is_cocoa_multithreaded = YES;
RTC_DCHECK([NSThread isMultiThreaded]);
}
}