Implement Lock and ConditionVariable for CrOS Nearby.
This CL includes a concrete implementation for the abstract classes Lock (which must be recursive) and ConditionVariable defined in the Nearby library. A related CL was previously abandoned (https://chromium-review.googlesource.com/c/chromium/src/+/1138871) because the Nearby C++ library already includes a DefaultLock and DefaultConditionVariable. However, that CL is being revived as this CL because a Chromium-specific Lock/CV implementation is required. For instance, Chromium requires a ScopedBlockingCall to be instantiated in scopes where blocking calls are made. DefaultConditionVariable does not include an instantiation of ScopedBlockingCall. This implementation of ConditionVariable uses a base::WaitableEvent, which instantiates a ScopedBlockingCall. This CL also includes a Lock implementation that is recursive, which is a requirement of Nearby, but is not originally supported by base::Lock. Because the actual Nearby library has yet to be merged into the CrOS directory, this CL includes stand-in Nearby abstract classes under the temporary directory //chromeos/components/nearby/library. This directory will be removed after the Nearby library gets imported to //third_party. Bug: 861813 Change-Id: I72660ed302e239d8f38a21728fc715b000057c13 Reviewed-on: https://chromium-review.googlesource.com/1145730 Commit-Queue: Kyle Qian <kyleqian@google.com> Reviewed-by:François Doray <fdoray@chromium.org> Reviewed-by:
Kyle Horimoto <khorimoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#586070}
Showing
Please register or sign in to comment