Home
last modified time | relevance | path

Searched refs:semaphore (Results 1 – 25 of 28) sorted by relevance

12

/packages/modules/Bluetooth/system/osi/test/internal/
Dsemaphore_test.cc14 semaphore_t* semaphore; member
27 EXPECT_NE(helper->semaphore, nullptr); in sleep_then_increment_counter()
28 if (helper->semaphore == nullptr) { in sleep_then_increment_counter()
34 semaphore_post(helper->semaphore); in sleep_then_increment_counter()
41 semaphore_t* semaphore = semaphore_new(0); in TEST_F() local
42 ASSERT_TRUE(semaphore != NULL); in TEST_F()
43 semaphore_free(semaphore); in TEST_F()
47 semaphore_t* semaphore = semaphore_new(3); in TEST_F() local
48 ASSERT_TRUE(semaphore != NULL); in TEST_F()
50 EXPECT_TRUE(semaphore_try_wait(semaphore)); in TEST_F()
[all …]
/packages/modules/Bluetooth/system/osi/src/internal/
Dsemaphore.cc55 void semaphore_free(semaphore_t* semaphore) { in semaphore_free() argument
56 if (!semaphore) return; in semaphore_free()
58 if (semaphore->fd != INVALID_FD) close(semaphore->fd); in semaphore_free()
59 osi_free(semaphore); in semaphore_free()
62 void semaphore_wait(semaphore_t* semaphore) { in semaphore_wait() argument
63 log::assert_that(semaphore != NULL, "assert failed: semaphore != NULL"); in semaphore_wait()
64 log::assert_that(semaphore->fd != INVALID_FD, in semaphore_wait()
68 if (eventfd_read(semaphore->fd, &value) == -1) in semaphore_wait()
72 bool semaphore_try_wait(semaphore_t* semaphore) { in semaphore_try_wait() argument
73 log::assert_that(semaphore != NULL, "assert failed: semaphore != NULL"); in semaphore_try_wait()
[all …]
/packages/modules/Bluetooth/system/osi/test/
Dalarm_test.cc34 static semaphore_t* semaphore; variable
73 semaphore = semaphore_new(0); in SetUp()
77 semaphore_free(semaphore); in TearDown()
86 semaphore_post(semaphore); in cb()
93 semaphore_post(semaphore); in ordered_cb()
139 semaphore_wait(semaphore); in TEST_F()
156 semaphore_wait(semaphore); in TEST_F()
175 semaphore_wait(semaphore); in TEST_F()
193 semaphore_wait(semaphore); in TEST_F()
211 semaphore_wait(semaphore); in TEST_F()
[all …]
/packages/modules/Bluetooth/system/osi/src/
Dfuture.cc34 semaphore_t* semaphore; // NULL semaphore means immediate future member
43 ret->semaphore = semaphore_new(0); in future_new()
44 if (!ret->semaphore) { in future_new()
71 semaphore_post(future->semaphore); in future_ready()
78 if (future->semaphore) semaphore_wait(future->semaphore); in future_await()
88 semaphore_free(future->semaphore); in future_free()
/packages/modules/Bluetooth/system/osi/include_internal/osi/
Dsemaphore.h37 void semaphore_free(semaphore_t* semaphore);
41 void semaphore_wait(semaphore_t* semaphore);
46 bool semaphore_try_wait(semaphore_t* semaphore);
49 void semaphore_post(semaphore_t* semaphore);
61 int semaphore_get_fd(const semaphore_t* semaphore);
/packages/modules/AppSearch/testing/appsindexertests/src/com/android/server/appsearch/appsindexer/
DAppsIndexerUserInstanceTest.java113 final Semaphore semaphore = new Semaphore(0); in testFirstRun_schedulesUpdate() local
124 semaphore.release(); in testFirstRun_schedulesUpdate()
136 semaphore.acquire(); in testFirstRun_schedulesUpdate()
141 semaphore.acquire(); in testFirstRun_schedulesUpdate()
164 final Semaphore semaphore = new Semaphore(0); in testFirstRun_updateAlreadyRan_doesNotUpdate() local
175 semaphore.release(); in testFirstRun_updateAlreadyRan_doesNotUpdate()
187 semaphore.acquire(); in testFirstRun_updateAlreadyRan_doesNotUpdate()
193 semaphore.acquire(); in testFirstRun_updateAlreadyRan_doesNotUpdate()
481 final Semaphore semaphore = new Semaphore(0); in testStart_subsequentRunWithNoScheduledJob_schedulesUpdateJob() local
492 semaphore.release(); in testStart_subsequentRunWithNoScheduledJob_schedulesUpdateJob()
[all …]
/packages/services/Car/libs/car-test-lib/src/android/car/test/mocks/
DJavaMockitoHelper.java62 public static void await(@NonNull Semaphore semaphore, long timeoutMs) in await() argument
64 Log.v(TAG, "waiting " + timeoutMs + "ms for semaphore " + semaphore); in await()
65 if (!semaphore.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in await()
67 throw new IllegalStateException(semaphore + " not released in " + timeoutMs + " ms"); in await()
/packages/modules/Bluetooth/system/osi/test/fuzzers/alarm/
Dfuzz_alarm.cc60 static btsemaphore semaphore; variable
68 semaphore.post(); in cb()
162 semaphore.wait(); in LLVMFuzzerTestOneInput()
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/provisioning/
DProvisioningManagerTest.java182 final Semaphore semaphore = new Semaphore(0); in testListener_preFinalizationCompleted() local
184 semaphore.release(1); in testListener_preFinalizationCompleted()
192 assertTrue(semaphore.tryAcquire(1, TimeUnit.SECONDS)); in testListener_preFinalizationCompleted()
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/preprovisioning/
DEncryptionControllerTest.java161 final Semaphore semaphore = new Semaphore(0); in runResumeProvisioningOnUiThread() local
169 semaphore.release(); in runResumeProvisioningOnUiThread()
173 semaphore.tryAcquire(RESUME_PROVISIONING_TIMEOUT_MS, TimeUnit.MILLISECONDS)); in runResumeProvisioningOnUiThread()
/packages/services/Car/tests/carservice_test/src/com/android/car/telemetry/
DCarTelemetryManagerTest.java173 Semaphore semaphore = new Semaphore(0); in testGetFinishedReport_noSuchConfig() local
177 semaphore.release(); in testGetFinishedReport_noSuchConfig()
183 semaphore.acquire(); in testGetFinishedReport_noSuchConfig()
/packages/modules/IntentResolver/java/src/com/android/intentresolver/contentpreview/
DCachingImagePreviewImageLoader.kt61 private val semaphore = Semaphore(maxConcurrency) in <lambda>() constant
95 runCatching { semaphore.withPermit { thumbnailLoader.invoke(uri) } } in <lambda>()
/packages/services/Car/tests/carservice_unit_test/src/android/car/test/mocks/
DJavaMockitoHelperTest.java58 Semaphore semaphore = new Semaphore(1); in testAwait_Semaphore() local
60 JavaMockitoHelper.await(semaphore, TIMEOUT_MS); in testAwait_Semaphore()
62 assertThat(semaphore.availablePermits()).isEqualTo(0); in testAwait_Semaphore()
/packages/modules/Permission/tests/cts/permissionpolicy/src/android/permissionpolicy/cts/
DNoReceiveSmsPermissionTest.java145 private boolean waitForForEvents(Semaphore semaphore, int expectedNumberOfEvents) { in waitForForEvents() argument
148 if (!semaphore.tryAcquire(SMS_DELIVERED_WAIT_TIME_MILLIS, TimeUnit.MILLISECONDS)) { in waitForForEvents()
/packages/modules/Bluetooth/system/osi/
DBUILD.gn42 "src/internal/semaphore.cc",
DAndroid.bp72 "src/internal/semaphore.cc",
/packages/modules/Bluetooth/system/gd/rust/linux/client/src/
Dmain.rs504 let semaphore = semaphore_fg.clone(); in handle_client_command() localVariable
510 let permit = semaphore.acquire().await; in handle_client_command()
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/power/
DCarPowerManagementServiceUnitTest.java3050 private static void waitForSemaphore(Semaphore semaphore, long timeoutMs) in waitForSemaphore() argument
3052 if (!semaphore.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForSemaphore()
3502 Semaphore semaphore = mSemaphores.get(signal); in waitFor() local
3503 if (semaphore == null) { in waitFor()
3506 waitForSemaphore(semaphore, timeoutMs); in waitFor()
3511 Semaphore semaphore = mSemaphores.get(signal); in sendingSignal() local
3512 if (semaphore == null) { in sendingSignal()
3515 semaphore.release(); in sendingSignal()
/packages/services/Telephony/tests/src/com/android/phone/satellite/accesscontrol/
DSatelliteAccessControllerTest.java551 private boolean waitForRequestIsSatelliteAllowedForCurrentLocationResult(Semaphore semaphore, in waitForRequestIsSatelliteAllowedForCurrentLocationResult() argument
555 if (!semaphore.tryAcquire(TIMEOUT, TimeUnit.MILLISECONDS)) { in waitForRequestIsSatelliteAllowedForCurrentLocationResult()
/packages/modules/Connectivity/service-t/src/com/android/server/net/
DNetworkStatsService.java3417 @NonNull Semaphore semaphore,
3425 mSemaphore = semaphore;
/packages/apps/TV/libs/m2/
Dguava-28.0-jre.jarMETA-INF/MANIFEST.MF META-INF/ META-INF/maven/ META- ...
Dguava-28.0-android.jarMETA-INF/MANIFEST.MF META-INF/ META-INF/maven/ META- ...
/packages/apps/ManagedProvisioning/studio-dev/StubGenerator/
DStubGenerator.jarMETA-INF/ META-INF/MANIFEST.MF org/ org/jf/ org/ ...
/packages/apps/TV/libs/
Dgoogle-java-format-1.7-all-deps.jarMETA-INF/ META-INF/MANIFEST.MF com/ com/google/ com/ ...
/packages/inputmethods/LatinIME/dictionaries/
Den_GB_wordlist.combined.gz

12