Add locking around waiting for initialization to finish, since calling dispatch_block_wait from multiple threads leads to undefined behavior. Initialize RTCUIApplicationStatusObserver earlier to give the initialization block more time to run on the main thread before starting to query the application state. http://www.dailymotion.com/video/x2mckmh BUG=b/65558688 Review-Url: https://codereview.webrtc.org/3009383002 Cr-Commit-Position: refs/heads/master@{#19822}
25 lines
638 B
Objective-C
25 lines
638 B
Objective-C
/*
|
|
* Copyright 2016 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.
|
|
*/
|
|
|
|
#if defined(WEBRTC_IOS)
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
@interface RTCUIApplicationStatusObserver : NSObject
|
|
|
|
+ (instancetype)sharedInstance;
|
|
+ (void)prepareForUse;
|
|
|
|
- (BOOL)isApplicationActive;
|
|
|
|
@end
|
|
|
|
#endif // WEBRTC_IOS
|