1# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. 2# 3# Use of this source code is governed by a BSD-style license 4# that can be found in the LICENSE file in the root of the source 5# tree. An additional intellectual property rights grant can be found 6# in the file PATENTS. All contributing project authors may 7# be found in the AUTHORS file in the root of the source tree. 8 9import("../../webrtc.gni") 10if (is_android) { 11 import("//build/config/android/config.gni") 12 import("//build/config/android/rules.gni") 13} 14 15rtc_library("yield") { 16 sources = [ 17 "yield.cc", 18 "yield.h", 19 ] 20 deps = [] 21} 22 23rtc_library("mutex") { 24 sources = [ 25 "mutex.cc", 26 "mutex.h", 27 "mutex_critical_section.h", 28 "mutex_pthread.h", 29 ] 30 if (rtc_use_absl_mutex) { 31 sources += [ "mutex_abseil.h" ] 32 } 33 34 deps = [ 35 ":yield", 36 "..:checks", 37 "..:macromagic", 38 "..:platform_thread_types", 39 "../system:unused", 40 ] 41 absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ] 42 if (rtc_use_absl_mutex) { 43 absl_deps += [ "//third_party/abseil-cpp/absl/synchronization" ] 44 } 45} 46 47rtc_library("rw_lock_wrapper") { 48 public = [ "rw_lock_wrapper.h" ] 49 sources = [ "rw_lock_wrapper.cc" ] 50 deps = [ "..:macromagic" ] 51 if (is_win) { 52 sources += [ 53 "rw_lock_win.cc", 54 "rw_lock_win.h", 55 ] 56 deps += [ "..:logging" ] 57 } else { 58 sources += [ 59 "rw_lock_posix.cc", 60 "rw_lock_posix.h", 61 ] 62 } 63} 64 65rtc_library("sequence_checker") { 66 sources = [ 67 "sequence_checker.cc", 68 "sequence_checker.h", 69 ] 70 deps = [ 71 ":mutex", 72 "..:checks", 73 "..:criticalsection", 74 "..:macromagic", 75 "..:platform_thread_types", 76 "..:stringutils", 77 "../../api/task_queue", 78 "../system:rtc_export", 79 ] 80} 81 82rtc_library("yield_policy") { 83 sources = [ 84 "yield_policy.cc", 85 "yield_policy.h", 86 ] 87 deps = [ "..:checks" ] 88 absl_deps = [ 89 "//third_party/abseil-cpp/absl/base:config", 90 "//third_party/abseil-cpp/absl/base:core_headers", 91 ] 92} 93 94if (rtc_include_tests) { 95 rtc_library("synchronization_unittests") { 96 testonly = true 97 sources = [ 98 "mutex_unittest.cc", 99 "yield_policy_unittest.cc", 100 ] 101 deps = [ 102 ":mutex", 103 ":yield", 104 ":yield_policy", 105 "..:checks", 106 "..:macromagic", 107 "..:rtc_base", 108 "..:rtc_event", 109 "../../test:test_support", 110 "//third_party/google_benchmark", 111 ] 112 } 113 114 rtc_library("mutex_benchmark") { 115 testonly = true 116 sources = [ "mutex_benchmark.cc" ] 117 deps = [ 118 ":mutex", 119 "../system:unused", 120 "//third_party/google_benchmark", 121 ] 122 } 123 124 rtc_library("sequence_checker_unittests") { 125 testonly = true 126 127 sources = [ "sequence_checker_unittest.cc" ] 128 deps = [ 129 ":sequence_checker", 130 "..:checks", 131 "..:rtc_base_approved", 132 "..:task_queue_for_test", 133 "../../api:function_view", 134 "../../test:test_main", 135 "../../test:test_support", 136 ] 137 } 138} 139