/ohos5.0/foundation/communication/bluetooth_service/services/bluetooth/stack/platform/src/ |
H A D | mutex.c | 32 if (mutex != NULL) { in MutexCreate() 33 if (pthread_mutex_init(&mutex->mutex, &attr) != 0) { in MutexCreate() 38 return mutex; in MutexCreate() 47 pthread_mutex_destroy(&mutex->mutex); in MutexDelete() 48 free(mutex); in MutexDelete() 53 ASSERT(mutex); in MutexLock() 54 pthread_mutex_lock(&mutex->mutex); in MutexLock() 59 ASSERT(mutex); in MutexUnlock() 60 pthread_mutex_unlock(&mutex->mutex); in MutexUnlock() 65 ASSERT(mutex); in MutexTryLock() [all …]
|
/ohos5.0/drivers/hdf_core/adapter/khdf/linux/osal/src/ |
H A D | osal_mutex.c | 29 struct mutex *mutex_tmp = NULL; in OsalMutexInit() 31 if (mutex == NULL) { in OsalMutexInit() 50 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexDestroy() 55 mutex_destroy((struct mutex *)mutex->realMutex); in OsalMutexDestroy() 57 mutex->realMutex = NULL; in OsalMutexDestroy() 65 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexLock() 70 mutex_lock((struct mutex *)mutex->realMutex); in OsalMutexLock() 78 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexTimedLock() 84 mutex_lock((struct mutex *)mutex->realMutex); in OsalMutexTimedLock() 92 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexUnlock() [all …]
|
/ohos5.0/base/security/huks/utils/mutex/ |
H A D | hks_mutex.c | 25 pthread_mutex_t mutex; member 31 if (mutex != NULL) { in HksMutexCreate() 32 int result = pthread_mutex_init(&mutex->mutex, NULL); in HksMutexCreate() 34 HKS_FREE(mutex); in HksMutexCreate() 35 mutex = NULL; in HksMutexCreate() 38 return mutex; in HksMutexCreate() 45 return pthread_mutex_lock(&mutex->mutex); in HksMutexLock() 52 return pthread_mutex_unlock(&mutex->mutex); in HksMutexUnlock() 57 if (mutex == NULL) { in HksMutexClose() 61 pthread_mutex_destroy(&mutex->mutex); in HksMutexClose() [all …]
|
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_sta/ |
H A D | sta_interface.cpp | 32 std::lock_guard<std::mutex> lock(mutex); in ~StaInterface() 53 std::lock_guard<std::mutex> lock(mutex); in EnableStaService() 70 std::lock_guard<std::mutex> lock(mutex); in DisableStaService() 82 std::lock_guard<std::mutex> lock(mutex); in ConnectToNetwork() 94 std::lock_guard<std::mutex> lock(mutex); in ConnectToDevice() 106 std::lock_guard<std::mutex> lock(mutex); in StartRoamToNetwork() 118 std::lock_guard<std::mutex> lock(mutex); in StartConnectToUserSelectNetwork() 130 std::lock_guard<std::mutex> lock(mutex); in ReConnect() 142 std::lock_guard<std::mutex> lock(mutex); in ReAssociate() 154 std::lock_guard<std::mutex> lock(mutex); in Disconnect() [all …]
|
/ohos5.0/docs/en/device-dev/kernel/ |
H A D | kernel-small-basic-trans-mutex.md | 6 …mutex) is a special binary semaphore used for exclusive access to shared resources. When a task ho… 57 | Initializing or destroying a mutex| - **LOS_MuxInit**: initializes a mutex.<br>- **LOS_MuxDestroy… 58 …g a mutex| - **LOS_MuxLock**: requests a mutex.<br>- **LOS_MuxTrylock**: requests a mutex without … 59 …Verifying a mutex| - **LOS_MuxIsValid**: checks whether the mutex release is valid.<br>- **LOS_Mux… 73 …acquires the mutex if the requested mutex is not held by any task or the task holding the mutex is… 83 - If no task is blocked by the specified mutex, the mutex is released successfully. 88 …ks cannot lock the same mutex. If a task attempts to lock a mutex held by another task, the task w… 131 /* Request a mutex. */ 142 /* Request a mutex. */ 160 /* Request a mutex. */ [all …]
|
H A D | kernel-mini-basic-ipc-mutex.md | 8 …mutex can be unlocked or locked. When a task holds a mutex, the mutex is locked and the task obtai… 20  29 | Creating or deleting a mutex| **LOS_MuxCreate**: creates a mutex.<br>**LOS_MuxDelete**: eeletes a… 30 | Requesting or releasing a mutex| **LOS_MuxPend**: requests a mutex.<br>**LOS_MuxPost**: releases … 42 …acquires the mutex if the requested mutex is not held by any task or the task holding the mutex is… 48 - If no task is blocked by the specified mutex, the mutex is released successfully. 96 /* Request a mutex. */ 108 /* Request a mutex. */ 127 /* Request a mutex. */ 135 /* Release the mutex. */ [all …]
|
/ohos5.0/base/security/device_auth/deps_adapter/os_adapter/impl/src/linux/ |
H A D | hc_condition.c | 29 int res = pthread_cond_wait(cond, &mutex->mutex); in Wait() 84 if (hcCond->mutex == NULL) { in HcCondWait() 88 hcCond->mutex->lock(hcCond->mutex); in HcCondWait() 91 hcCond->mutex->unlock(hcCond->mutex); in HcCondWait() 99 hcCond->mutex->unlock(hcCond->mutex); in HcCondWait() 110 hcCond->mutex->lock(hcCond->mutex); in HcCondNotify() 118 hcCond->mutex->unlock(hcCond->mutex); in HcCondNotify() 142 if (mutex != NULL) { in InitHcCond() 143 hcCond->mutex = mutex; in InitHcCond() 170 HcFree(hcCond->mutex); in DestroyHcCond() [all …]
|
/ohos5.0/base/startup/init/services/param/liteos/ |
H A D | param_osadp.c | 189 pthread_mutex_init(&mutex->mutex, &mutexattr); in ParamMutexCreate() 195 if (pthread_mutex_lock(&mutex->mutex) != 0) { in ParamMutexPend() 204 pthread_mutex_unlock(&mutex->mutex); in ParamMutexPost() 211 uint32_t ret = pthread_mutex_destroy(&mutex->mutex); in ParamMutexDelete() 296 uint32_t ret = LOS_MuxCreate(&mutex->mutex); in ParamMutexCreate() 304 uint32_t ret = LOS_MuxPend(mutex->mutex, LOS_WAIT_FOREVER); in ParamMutexPend() 305 PARAM_CHECK(ret == LOS_OK, return -1, "Failed to mutex lock ret %d %d", ret, mutex->mutex); in ParamMutexPend() 312 uint32_t ret = LOS_MuxPost(mutex->mutex); in ParamMutexPost() 313 PARAM_CHECK(ret == LOS_OK, return -1, "Failed to mutex lock ret %d %d", ret, mutex->mutex); in ParamMutexPost() 320 uint32_t ret = LOS_MuxDelete(mutex->mutex); in ParamMutexDelete() [all …]
|
/ohos5.0/base/security/device_auth/deps_adapter/os_adapter/impl/src/ |
H A D | hc_mutex.c | 24 static int HcMutexLock(HcMutex *mutex) in HcMutexLock() argument 26 if (mutex == NULL) { in HcMutexLock() 29 int res = pthread_mutex_lock(&mutex->mutex); in HcMutexLock() 38 if (mutex == NULL) { in HcMutexUnlock() 41 int res = pthread_mutex_unlock(&mutex->mutex); in HcMutexUnlock() 49 if (mutex == NULL) { in InitHcMutex() 52 int res = pthread_mutex_init(&mutex->mutex, NULL); in InitHcMutex() 57 mutex->lock = HcMutexLock; in InitHcMutex() 58 mutex->unlock = HcMutexUnlock; in InitHcMutex() 64 if (mutex == NULL) { in DestroyHcMutex() [all …]
|
/ohos5.0/base/hiviewdfx/faultloggerd/test/unittest/process_dump/ |
H A D | lock_parser_test.cpp | 84 pthread_mutex_lock(&mutex); in LockMutex() 107 pthread_mutex_t mutex; variable 111 LockMutex(mutex); 161 pthread_mutex_t mutex; variable 165 LockMutex(mutex); 215 pthread_mutex_t mutex; variable 217 LockMutex(mutex); 254 pthread_mutex_t mutex; variable 256 LockMutex(mutex); 293 pthread_mutex_t mutex; variable [all …]
|
/ohos5.0/drivers/hdf_core/adapter/khdf/liteos/osal/src/ |
H A D | osal_mutex.c | 39 int32_t OsalMutexInit(struct OsalMutex *mutex) in OsalMutexInit() argument 44 if (mutex == NULL) { in OsalMutexInit() 52 mutex->realMutex = NULL; in OsalMutexInit() 57 mutex->realMutex = (void *)mux; in OsalMutexInit() 59 mutex->realMutex = NULL; in OsalMutexInit() 72 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexDestroy() 83 OsalMemFree(mutex->realMutex); in OsalMutexDestroy() 84 mutex->realMutex = NULL; in OsalMutexDestroy() 92 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexLock() 110 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexTimedLock() [all …]
|
/ohos5.0/drivers/hdf_core/framework/support/posix/src/ |
H A D | osal_mutex.c | 18 int32_t OsalMutexInit(struct OsalMutex *mutex) in OsalMutexInit() argument 23 if (mutex == NULL) { in OsalMutexInit() 28 mutex->realMutex = NULL; in OsalMutexInit() 43 mutex->realMutex = (void *)mutexTmp; in OsalMutexInit() 52 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexDestroy() 61 OsalMemFree(mutex->realMutex); in OsalMutexDestroy() 62 mutex->realMutex = NULL; in OsalMutexDestroy() 67 int32_t OsalMutexLock(struct OsalMutex *mutex) in OsalMutexLock() argument 69 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexLock() 80 if (mutex == NULL || mutex->realMutex == NULL) { in OsalMutexTimedLock() [all …]
|
/ohos5.0/drivers/hdf_core/adapter/khdf/liteos_m/osal/src/ |
H A D | osal_mutex.c | 39 int32_t OsalMutexInit(struct OsalMutex *mutex) in OsalMutexInit() argument 44 if (mutex == NULL) { in OsalMutexInit() 51 mutex->realMutex = (void *)(uintptr_t)muxId; in OsalMutexInit() 61 int32_t OsalMutexDestroy(struct OsalMutex *mutex) in OsalMutexDestroy() argument 65 if (mutex == NULL || mutex->realMutex == (void *)(uintptr_t)HDF_INVALID_MUX_ID) { in OsalMutexDestroy() 76 mutex->realMutex = (void *)(uintptr_t)HDF_INVALID_MUX_ID; in OsalMutexDestroy() 80 int32_t OsalMutexLock(struct OsalMutex *mutex) in OsalMutexLock() argument 84 if (mutex == NULL || mutex->realMutex == (void *)(uintptr_t)HDF_INVALID_MUX_ID) { in OsalMutexLock() 102 if (mutex == NULL || mutex->realMutex == (void *)(uintptr_t)HDF_INVALID_MUX_ID) { in OsalMutexTimedLock() 119 int32_t OsalMutexUnlock(struct OsalMutex *mutex) in OsalMutexUnlock() argument [all …]
|
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_p2p/ |
H A D | wifi_p2p_group_info_proxy.cpp | 21 std::unique_lock<std::mutex> lock(proxyMutex); in operator ==() 27 std::unique_lock<std::mutex> lock(proxyMutex); in operator !=() 33 std::unique_lock<std::mutex> lock(proxyMutex); in SetIsGroupOwner() 39 std::unique_lock<std::mutex> lock(proxyMutex); in IsGroupOwner() 45 std::unique_lock<std::mutex> lock(proxyMutex); in SetOwner() 51 std::unique_lock<std::mutex> lock(proxyMutex); in GetOwner() 57 std::unique_lock<std::mutex> lock(proxyMutex); in SetPassphrase() 63 std::unique_lock<std::mutex> lock(proxyMutex); in GetPassphrase() 69 std::unique_lock<std::mutex> lock(proxyMutex); in SetInterface() 75 std::unique_lock<std::mutex> lock(proxyMutex); in GetInterface() [all …]
|
/ohos5.0/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_scan/ |
H A D | scan_interface.cpp | 28 std::lock_guard<std::mutex> lock(mutex); in ~ScanInterface() 49 std::lock_guard<std::mutex> lock(mutex); in Init() 71 std::lock_guard<std::mutex> lock(mutex); in UnInit() 80 std::lock_guard<std::mutex> lock(mutex); in Scan() 88 std::lock_guard<std::mutex> lock(mutex); in ScanWithParam() 97 std::lock_guard<std::mutex> lock(mutex); in DisableScan() 105 std::lock_guard<std::mutex> lock(mutex); in StartWifiPnoScan() 118 std::lock_guard<std::mutex> lock(mutex); in OnScreenStateChanged() 130 std::lock_guard<std::mutex> lock(mutex); in OnStandbyStateChanged() 138 std::lock_guard<std::mutex> lock(mutex); in OnClientModeStatusChanged() [all …]
|
/ohos5.0/foundation/communication/dsoftbus/adapter/common/include/ |
H A D | softbus_adapter_thread.h | 73 int32_t SoftBusMutexInit(SoftBusMutex *mutex, SoftBusMutexAttr *mutexAttr); 74 int32_t SoftBusMutexLockInner(SoftBusMutex *mutex); 75 int32_t SoftBusMutexUnlockInner(SoftBusMutex *mutex); 76 int32_t SoftBusMutexDestroy(SoftBusMutex *mutex); 78 static inline bool CheckMutexIsNull(const SoftBusMutex *mutex) in CheckMutexIsNull() argument 80 return (mutex == NULL) || ((void *)(*mutex) == NULL); in CheckMutexIsNull() 115 static inline void SoftBusMutexUnlockAuto(SoftBusMutex **mutex) in SoftBusMutexUnlockAuto() argument 117 if (mutex) { in SoftBusMutexUnlockAuto() 118 SoftBusMutexUnlock(*mutex); in SoftBusMutexUnlockAuto() 122 #define SOFTBUS_LOCK_GUARD(mutex) \ argument [all …]
|
/ohos5.0/foundation/communication/wifi/wifi/frameworks/native/src/ |
H A D | wifi_p2p_impl.cpp | 78 std::lock_guard<std::mutex> lock(mutex_); in EnableP2p() 85 std::lock_guard<std::mutex> lock(mutex_); in DisableP2p() 92 std::lock_guard<std::mutex> lock(mutex_); in DiscoverDevices() 99 std::lock_guard<std::mutex> lock(mutex_); in StopDiscoverDevices() 106 std::lock_guard<std::mutex> lock(mutex_); in DiscoverServices() 113 std::lock_guard<std::mutex> lock(mutex_); in StopDiscoverServices() 120 std::lock_guard<std::mutex> lock(mutex_); in RequestService() 127 std::lock_guard<std::mutex> lock(mutex_); in PutLocalP2pService() 134 std::lock_guard<std::mutex> lock(mutex_); in DeleteLocalP2pService() 141 std::lock_guard<std::mutex> lock(mutex_); in StartP2pListen() [all …]
|
H A D | wifi_device_impl.cpp | 124 std::lock_guard<std::mutex> lock(mutex_); in EnableWifi() 131 std::lock_guard<std::mutex> lock(mutex_); in DisableWifi() 138 std::lock_guard<std::mutex> lock(mutex_); in InitWifiProtect() 145 std::lock_guard<std::mutex> lock(mutex_); in GetWifiProtectRef() 152 std::lock_guard<std::mutex> lock(mutex_); in PutWifiProtectRef() 159 std::lock_guard<std::mutex> lock(mutex_); in IsHeldWifiProtectRef() 185 std::lock_guard<std::mutex> lock(mutex_); in RemoveCandidateConfig() 192 std::lock_guard<std::mutex> lock(mutex_); in RemoveCandidateConfig() 199 std::lock_guard<std::mutex> lock(mutex_); in AddDeviceConfig() 206 std::lock_guard<std::mutex> lock(mutex_); in UpdateDeviceConfig() [all …]
|
/ohos5.0/foundation/multimodalinput/input/service/connect_manager/src/ |
H A D | multimodal_input_connect_manager.cpp | 56 std::lock_guard<std::mutex> guard(lock_); in AllocSocketPair() 78 std::lock_guard<std::mutex> guard(lock_); in GetDisplayBindInfo() 86 std::lock_guard<std::mutex> guard(lock_); in GetAllMmiSubscribedEvents() 93 std::lock_guard<std::mutex> guard(lock_); in SetDisplayBind() 100 std::lock_guard<std::mutex> guard(lock_); in GetWindowPid() 108 std::lock_guard<std::mutex> guard(lock_); in AddInputEventFilter() 115 std::lock_guard<std::mutex> guard(lock_); in NotifyNapOnline() 122 std::lock_guard<std::mutex> guard(lock_); in RemoveInputEventObserver() 129 std::lock_guard<std::mutex> guard(lock_); in RemoveInputEventFilter() 136 std::lock_guard<std::mutex> guard(lock_); in SetMouseScrollRows() [all …]
|
/ohos5.0/foundation/window/window_manager/window_scene/test/dms_unittest/ |
H A D | fold_screen_controller_test.cpp | 67 std::recursive_mutex mutex; variable 94 std::recursive_mutex mutex; variable 110 std::recursive_mutex mutex; variable 145 std::recursive_mutex mutex; variable 161 std::recursive_mutex mutex; variable 177 std::recursive_mutex mutex; variable 192 std::recursive_mutex mutex; variable 207 std::recursive_mutex mutex; variable 222 std::recursive_mutex mutex; variable 238 std::recursive_mutex mutex; variable [all …]
|
H A D | dual_display_fold_policy_test.cpp | 70 std::recursive_mutex mutex; variable 96 std::recursive_mutex mutex; variable 110 std::recursive_mutex mutex; variable 126 std::recursive_mutex mutex; variable 139 std::recursive_mutex mutex; variable 153 std::recursive_mutex mutex; variable 169 std::recursive_mutex mutex; variable 185 std::recursive_mutex mutex; variable 221 std::recursive_mutex mutex; variable 235 std::recursive_mutex mutex; variable [all …]
|
/ohos5.0/foundation/communication/ipc/ipc/native/c/rpc/src/ |
H A D | rpc_process_skeleton.c | 51 .mutex = PTHREAD_MUTEX_INITIALIZER, 88 pthread_mutex_lock(&g_stubObjectList.mutex); in AddStubByIndex() 90 pthread_mutex_unlock(&g_stubObjectList.mutex); in AddStubByIndex() 97 pthread_mutex_lock(&g_stubObjectList.mutex); in QueryStubByIndex() 105 pthread_mutex_unlock(&g_stubObjectList.mutex); in QueryStubByIndex() 173 pthread_mutex_lock(&threadLockInfo->mutex); in AddDataThreadInWait() 183 pthread_mutex_unlock(&threadLockInfo->mutex); in AddDataThreadInWait() 211 pthread_mutex_lock(&g_processInfoList.mutex); in AddDataInfoToThread() 219 pthread_mutex_lock(&g_processInfoList.mutex); in PopDataInfoFromThread() 385 pthread_mutex_lock(&threadLockInfo->mutex); in AddSendThreadInWait() [all …]
|
/ohos5.0/base/security/device_security_level/baselib/utils/include/ |
H A D | utils_mutex.h | 41 pthread_mutex_t mutex; member 44 inline static void InitMutex(Mutex *mutex) in InitMutex() argument 46 (void)pthread_mutex_init(&mutex->mutex, NULL); in InitMutex() 49 inline static void InitRecursiveMutex(Mutex *mutex) in InitRecursiveMutex() argument 54 (void)pthread_mutex_init(&mutex->mutex, &attr); in InitRecursiveMutex() 57 inline static void LockMutex(Mutex *mutex) in LockMutex() argument 59 int ret = pthread_mutex_lock(&(mutex->mutex)); in LockMutex() 65 inline static void UnlockMutex(Mutex *mutex) in UnlockMutex() argument 67 int ret = pthread_mutex_unlock(&(mutex->mutex)); in UnlockMutex()
|
/ohos5.0/foundation/multimedia/audio_framework/services/audio_policy/client/src/ |
H A D | audio_policy_client_stub_impl.cpp | 28 std::lock_guard<std::mutex> lockCbMap(volumeKeyEventMutex_); in AddVolumeKeyEventCallback() 35 std::lock_guard<std::mutex> lockCbMap(volumeKeyEventMutex_); in RemoveVolumeKeyEventCallback() 52 std::lock_guard<std::mutex> lockCbMap(volumeKeyEventMutex_); in GetVolumeKeyEventCallbackSize() 58 std::lock_guard<std::mutex> lockCbMap(volumeKeyEventMutex_); in OnVolumeKeyEvent() 162 std::lock_guard<std::mutex> lockCbMap(deviceChangeMutex_); in AddDeviceChangeCallback() 170 std::lock_guard<std::mutex> lockCbMap(deviceChangeMutex_); in RemoveDeviceChangeCallback() 249 std::lock_guard<std::mutex> lockCbMap(ringerModeMutex_); in AddRingerModeCallback() 256 std::lock_guard<std::mutex> lockCbMap(ringerModeMutex_); in RemoveRingerModeCallback() 263 std::lock_guard<std::mutex> lockCbMap(ringerModeMutex_); in RemoveRingerModeCallback() 277 std::lock_guard<std::mutex> lockCbMap(ringerModeMutex_); in GetRingerModeCallbackSize() [all …]
|
/ohos5.0/drivers/peripheral/camera/vdi_base/common/buffer_manager/src/ |
H A D | image_buffer.cpp | 181 std::lock_guard<std::mutex> l(l_); in SetIndex() 188 std::lock_guard<std::mutex> l(l_); in SetWidth() 195 std::lock_guard<std::mutex> l(l_); in SetCurWidth() 202 std::lock_guard<std::mutex> l(l_); in SetHeight() 209 std::lock_guard<std::mutex> l(l_); in SetCurHeight() 216 std::lock_guard<std::mutex> l(l_); in SetStride() 223 std::lock_guard<std::mutex> l(l_); in SetFormat() 229 std::lock_guard<std::mutex> l(l_); in SetCurFormat() 236 std::lock_guard<std::mutex> l(l_); in SetSize() 242 std::lock_guard<std::mutex> l(l_); in SetSuffaceBufferAddr() [all …]
|