Home
last modified time | relevance | path

Searched refs:sem (Results 1 - 19 of 19) sorted by relevance

/foundation/communication/bluetooth_service/services/bluetooth/stack/platform/linux/
H A Dsemaphore_linux.c63 void SemaphoreDelete(Semaphore *sem) in SemaphoreDelete() argument
65 if (sem == NULL) { in SemaphoreDelete()
69 if (sem->fd != -1) { in SemaphoreDelete()
70 close(sem->fd); in SemaphoreDelete()
73 MutexDelete(sem->mutex); in SemaphoreDelete()
74 free(sem); in SemaphoreDelete()
77 void SemaphoreWait(const Semaphore *sem) in SemaphoreWait() argument
79 ASSERT(sem); in SemaphoreWait()
82 eventfd_read(sem->fd, &val); in SemaphoreWait()
85 int32_t SemaphoreTryWait(Semaphore *sem) in SemaphoreTryWait() argument
116 SemaphorePost(const Semaphore *sem) SemaphorePost() argument
123 SemaphoreTryPost(Semaphore *sem) SemaphoreTryPost() argument
153 SemaphoreGetfd(const Semaphore *sem) SemaphoreGetfd() argument
[all...]
/foundation/communication/dsoftbus/components/nstackx/fillp/src/public/src/
H A Dcallbacks.c582 IO volatile FILLP_ULONG *sem, in FillpSysArchCompAndWwap()
587 return (FILLP_INT)__sync_bool_compare_and_swap(sem, (FILLP_LLONG)(FILLP_ULLONG)oldValue, in FillpSysArchCompAndWwap()
590 return ((InterlockedCompareExchange((LONG volatile *)sem, (LONG)exchange, (LONG)oldValue)) == (LONG)oldValue); in FillpSysArchCompAndWwap()
647 #define FILLP_ADAPT_SYS_ARCH_SEM_COND_INIT(sem, value) do { \
651 (void)pthread_cond_init(&(sem)->cond, &attr); \
653 (sem)->counter = (FILLP_INT)(value); \
656 #define FILLP_ADAPT_SYS_ARCH_SEM_INIT(sem, value, ret) do { \
657 if (pthread_mutex_init(&(sem)->mutex, FILLP_NULL_PTR) == 0) { \
658 FILLP_ADAPT_SYS_ARCH_SEM_COND_INIT(sem, value); \
667 #define FILLP_ADAPT_SYS_ARCH_SEM_INIT(sem, valu
581 FillpSysArchCompAndWwap( IO volatile FILLP_ULONG *sem, IN volatile FILLP_ULONG oldValue, IN volatile FILLP_ULONG exchange) FillpSysArchCompAndWwap() argument
685 FillpArchInitSem(IO SYS_ARCH_SEM *sem, IN FILLP_ULONG value) FillpArchInitSem() argument
711 FillpAdaptSysArchRwsemInit(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemInit() argument
726 FillpAdaptSysArchRwsemTryrdwait(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemTryrdwait() argument
745 FillpAdaptSysArchRwsemRdPost(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemRdPost() argument
759 FillpAdaptSysArchRwsemTrywrwait(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemTrywrwait() argument
768 FillpAdaptSysArchRwsemWrPost(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemWrPost() argument
774 FillpAdaptSysArchRwsemDestroy(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemDestroy() argument
812 FillpAdaptSysArchRwsemInit(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemInit() argument
818 FillpAdaptSysArchRwsemTryrdwait(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemTryrdwait() argument
834 FillpAdaptSysArchRwsemTrywrwait(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemTrywrwait() argument
850 FillpAdaptSysArchRwsemRdPost(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemRdPost() argument
863 FillpAdaptSysArchRwsemWrPost(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemWrPost() argument
876 FillpAdaptSysArchRwsemDestroy(SYS_ARCH_RW_SEM *sem) FillpAdaptSysArchRwsemDestroy() argument
892 FillpSemTryWait(IN SYS_ARCH_SEM *sem) FillpSemTryWait() argument
937 FillpSemWait(IN SYS_ARCH_SEM *sem) FillpSemWait() argument
969 FillpSemPost(IN SYS_ARCH_SEM *sem) FillpSemPost() argument
995 FillpSemDestroy(IN SYS_ARCH_SEM *sem) FillpSemDestroy() argument
1024 FillpArchInitRwSem(IO SYS_ARCH_RW_SEM *sem) FillpArchInitRwSem() argument
1030 FillpRwSemTryRdWait(IN SYS_ARCH_RW_SEM *sem) FillpRwSemTryRdWait() argument
1035 FillpRwSemTryWrWait(IN SYS_ARCH_RW_SEM *sem) FillpRwSemTryWrWait() argument
1045 FillpRwSemDestroy(IN SYS_ARCH_RW_SEM *sem) FillpRwSemDestroy() argument
1055 FillpRwSemWrPost(IN SYS_ARCH_RW_SEM *sem) FillpRwSemWrPost() argument
1065 FillpRwSemRdPost(IN SYS_ARCH_RW_SEM *sem) FillpRwSemRdPost() argument
1224 FillpAdaptSysArchSemClose(SYS_ARCH_SEM *sem) FillpAdaptSysArchSemClose() argument
1241 FillpAdaptSysArchSemClose(SYS_ARCH_SEM *sem) FillpAdaptSysArchSemClose() argument
1249 FillpSysArchSemClose(SYS_ARCH_SEM *sem) FillpSysArchSemClose() argument
1255 FillpAdaptSysArchSemWaitTimeout(SYS_ARCH_SEM *sem, FILLP_SLONG timeout) FillpAdaptSysArchSemWaitTimeout() argument
1298 FillpAdaptSysArchSemWaitTimeout(SYS_ARCH_SEM *sem, FILLP_SLONG timeout) FillpAdaptSysArchSemWaitTimeout() argument
1308 FillpAdaptSysArchSemTryWait(SYS_ARCH_SEM *sem, FILLP_SLONG timeout) FillpAdaptSysArchSemTryWait() argument
1316 FillpSysArchSemWaitTimeout(SYS_ARCH_SEM *sem, FILLP_SLONG timeout) FillpSysArchSemWaitTimeout() argument
[all...]
/foundation/ability/ability_runtime/test/moduletest/ipc_ability_scheduler_test/
H A Dipc_ability_scheduler_module_test.cpp73 Semaphore sem(0); in HWTEST_F()
93 sem.Post(); in HWTEST_F()
101 sem.Wait(); in HWTEST_F()
118 Semaphore sem(0); in HWTEST_F()
140 sem.Post(); in HWTEST_F()
147 sem.Wait(); in HWTEST_F()
165 Semaphore sem(0); in HWTEST_F()
180 sem.Post(); in HWTEST_F()
187 sem.Wait(); in HWTEST_F()
203 Semaphore sem( in HWTEST_F()
[all...]
/foundation/communication/bluetooth_service/services/bluetooth/stack/platform/include/
H A Dsemaphore.h39 * @param sem Semaphore pointer.
42 void SemaphoreDelete(Semaphore *sem);
47 * @param sem Semaphore pointer.
50 void SemaphoreWait(const Semaphore *sem);
55 * @param sem Semaphore pointer.
59 int32_t SemaphoreTryWait(Semaphore *sem);
64 * @param sem Semaphore pointer.
67 void SemaphorePost(const Semaphore *sem);
72 * @param sem Semaphore pointer.
76 int32_t SemaphoreTryPost(Semaphore *sem);
[all...]
/foundation/communication/dsoftbus/components/nstackx/nstackx_util/platform/liteos/
H A Dsys_util.c93 int32_t SemInit(sem_t *sem, int pshared, unsigned int value) in SemInit() argument
95 return sem_init(sem, pshared, value); in SemInit()
98 void SemGetValue(sem_t *sem, int *sval) in SemGetValue() argument
100 if (sem_getvalue(sem, sval) != 0) { in SemGetValue()
101 LOGE(TAG, "sem get error: %d", errno); in SemGetValue()
105 void SemPost(sem_t *sem) in SemPost() argument
107 if (sem_post(sem) != 0) { in SemPost()
108 LOGE(TAG, "sem post error: %d", errno); in SemPost()
112 void SemWait(sem_t *sem) in SemWait() argument
114 if (sem_wait(sem) ! in SemWait()
119 SemDestroy(sem_t *sem) SemDestroy() argument
[all...]
/foundation/communication/dsoftbus/components/nstackx/fillp/src/public/include/
H A Dcallbacks.h216 FILLP_INT FillpSysArchCompAndWwap(IO volatile FILLP_ULONG *sem,
244 FILLP_INT FillpSemTryWait(IN SYS_ARCH_SEM *sem);
251 FILLP_INT FillpSemWait(IN SYS_ARCH_SEM *sem);
253 FILLP_INT FillpRwSemTryRdWait(IN SYS_ARCH_RW_SEM *sem);
255 FILLP_INT FillpRwSemTryWrWait(IN SYS_ARCH_RW_SEM *sem);
263 FILLP_INT FillpRwSemRdPost(IN SYS_ARCH_RW_SEM *sem);
271 FILLP_INT FillpRwSemWrPost(IN SYS_ARCH_RW_SEM *sem);
278 FILLP_INT FillpRwSemDestroy(IN SYS_ARCH_RW_SEM *sem);
285 FILLP_INT FillpSemPost(IN SYS_ARCH_SEM *sem);
292 FILLP_INT FillpSemDestroy(IN SYS_ARCH_SEM *sem);
[all...]
/foundation/communication/dsoftbus/components/nstackx/nstackx_util/platform/unix/
H A Dsys_util.c146 int32_t SemInit(sem_t *sem, int pshared, unsigned int value) in SemInit() argument
148 return sem_init(sem, pshared, value); in SemInit()
151 void SemGetValue(sem_t *sem, int *sval) in SemGetValue() argument
153 if (sem_getvalue(sem, sval) != 0) { in SemGetValue()
154 LOGE(TAG, "sem get error: %d", errno); in SemGetValue()
158 void SemPost(sem_t *sem) in SemPost() argument
160 if (sem_post(sem) != 0) { in SemPost()
161 LOGE(TAG, "sem post error: %d", errno); in SemPost()
165 void SemWait(sem_t *sem) in SemWait() argument
167 if (sem_wait(sem) ! in SemWait()
172 SemDestroy(sem_t *sem) SemDestroy() argument
[all...]
/foundation/multimodalinput/input/frameworks/proxy/events/test/
H A Dinput_manager_filter_manual_test.cpp233 sem_t &sem; member
235 PointerFilter(int32_t exceptX, int32_t exceptY, sem_t &sem, bool &result) in PointerFilter()
236 : exceptX(exceptX), exceptY(exceptY), sem(sem), result(result) in PointerFilter()
269 int32_t ret = sem_post(&sem);
291 void WaitPointerEnd(sem_t &sem) in WaitPointerEnd() argument
298 ret = sem_timedwait(&sem, &ts); in WaitPointerEnd()
305 sem_t sem; in HWTEST_F() local
306 int32_t ret = sem_init(&sem, 0, 0); in HWTEST_F()
309 auto filter = std::make_shared<PointerFilter>(10, 10, sem, resul in HWTEST_F()
339 sem_t &sem; global() member
367 WaitKeyEnd(sem_t &sem) WaitKeyEnd() argument
377 SimulateKeyEvent(bool &resultA, bool &resultB, const int32_t KEYCODE, bool isKeyAEvent, sem_t &sem) SimulateKeyEvent() argument
[all...]
/foundation/communication/dsoftbus/components/nstackx/fillp/include/
H A Dfillpcallbacks.h359 * @param[out] sem Indicates a pointer to the destination value.
361 * @param[in] newValue Indicates the value to compare to sem.
363 * This returns the initial value of sem parameter.
365 typedef FILLP_INT (*FillpSysArchCompAndSwapFunc)(IO volatile FILLP_ULONG *sem,
405 * @param[in] sem Indicates a pointer to semaphore.
408 * Initialize the semaphore in sem on successful or error on failure.
410 typedef FILLP_INT (*FillpSemFunc)(IO SYS_ARCH_SEM *sem, IN FILLP_ULONG value);
415 * This callback is to lock the semaphore referenced by sem only if the semaphore is currently not locked.
417 * @param[out] sem Indicates a pointer to a semaphore to be locked.
422 typedef FILLP_INT (*FillpSemTryWaitFunc)(IN SYS_ARCH_SEM *sem);
[all...]
H A Dfillptypes.h271 #define ERR_FAILURE (-7) /* general sem init failures and socket init failures */
425 volatile FILLP_ULONG sem; /* Indicates a semaphore. */ member
/foundation/communication/dsoftbus/components/nstackx/nstackx_util/interface/
H A Dnstackx_util.h64 NSTACKX_EXPORT void SemGetValue(sem_t *sem, int *sval);
65 NSTACKX_EXPORT void SemPost(sem_t *sem);
66 NSTACKX_EXPORT void SemWait(sem_t *sem);
67 NSTACKX_EXPORT void SemDestroy(sem_t *sem);
68 NSTACKX_EXPORT int32_t SemInit(sem_t *sem, int pshared, unsigned int value);
/foundation/ability/ability_runtime/test/moduletest/common/ams/app_mgr_service_test/
H A Dams_app_mgr_service_module_test.cpp260 Semaphore sem(0); in HWTEST_F()
264 sem.Post(); in HWTEST_F()
294 Semaphore sem(0); in HWTEST_F()
298 sem.Post(); in HWTEST_F()
328 Semaphore sem(0); in HWTEST_F()
330 auto mockHandler = [&testResult, testRecordId, &sem](const int32_t recordId) { in HWTEST_F()
332 sem.Post(); in HWTEST_F()
383 Semaphore sem(0); in HWTEST_F()
384 auto mockHandler = [testProcessName, testPid, &sem](std::vector<RunningProcessInfo>& runningProcessInfo) { in HWTEST_F()
388 sem in HWTEST_F()
[all...]
/foundation/communication/bluetooth_service/services/bluetooth/stack/src/l2cap/
H A Dl2cap_if.c655 Semaphore *sem; member
667 SemaphorePost(ctx->sem); in L2cifStartup()
676 Semaphore *sem = NULL; in L2CIF_Startup() local
683 sem = SemaphoreCreate(0); in L2CIF_Startup()
684 if (sem == NULL) { in L2CIF_Startup()
691 SemaphoreDelete(sem); in L2CIF_Startup()
695 ctx->sem = sem; in L2CIF_Startup()
701 SemaphoreDelete(sem); in L2CIF_Startup()
705 SemaphoreWait(sem); in L2CIF_Startup()
729 Semaphore *sem = NULL; L2CIF_Shutdown() local
[all...]
/foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/test/unittest/
H A Dmeta_data_manager_test.cpp92 OHOS::Semaphore sem(0); in HWTEST_F()
96 prefix, [&changedKey, &sem](const std::string &key, const std::string &value, int32_t action) { in HWTEST_F()
98 sem.Post(); in HWTEST_F()
104 sem.Wait(); in HWTEST_F()
/foundation/ability/ability_runtime/test/unittest/lifecycle_test/
H A Dlifecycle_test_base.h82 static int SemTimedWaitMillis(long msecs, sem_t& sem) in SemTimedWaitMillis() argument
95 return sem_timedwait(&sem, &ts); in SemTimedWaitMillis()
/foundation/multimedia/media_lite/services/recorder_lite/impl/src/
H A Drecorder_sink.cpp284 sem_post(&sink->sem); in SinkOnError()
301 sem_post(&sink->sem); in SinkOnInfo()
320 int32_t ret = sem_init(&sink->sem, 0, 0); in MessageThread()
327 sem_wait(&sink->sem); in MessageThread()
341 sem_destroy(&sink->sem); in MessageThread()
410 sem_post(&sem); in Stop()
/foundation/ability/ability_runtime/test/moduletest/common/ams/ipc_app_scheduler_test/
H A Dams_ipc_app_scheduler_module_test.cpp276 OHOS::Semaphore sem(0); in HWTEST_F()
287 sem.Post(); in HWTEST_F()
294 sem.Wait(); in HWTEST_F()
/foundation/multimedia/media_lite/services/recorder_lite/impl/include/
H A Drecorder_sink.h72 sem_t sem; member in OHOS::Media::RecorderSink
/foundation/communication/dsoftbus/components/nstackx/nstackx_core/dfile/core/
H A Dnstackx_file_manager_client.c35 static void CheckSendListFullAndWait(FileManager *fileManager, sem_t *sem) in CheckSendListFullAndWait() argument
38 SemGetValue(sem, &semValue); in CheckSendListFullAndWait()
42 SemWait(sem); in CheckSendListFullAndWait()

Completed in 12 milliseconds