Lines Matching full:mutex
33 * @defgroup los_mux Mutex
50 * Mutex error code: The memory request fails.
60 * Mutex error code: The mutex is not usable.
64 …* Solution: Check whether the mutex ID and the mutex state are applicable for the current operatio…
70 * Mutex error code: Null pointer.
80 * Mutex error code: No mutex is available and the mutex request fails.
90 * Mutex error code: The mutex fails to be locked in non-blocking mode because it is locked by anoth…
94 * Solution: Lock the mutex after it is unlocked by the thread that owns it, or set a waiting time.
100 * Mutex error code: The mutex is being locked during an interrupt.
104 * Solution: Check whether the mutex is being locked during an interrupt.
110 * Mutex error code: A thread locks a mutex after waiting for the mutex to be unlocked by another th…
116 * thread will not wait for the mutex to become available.
122 * Mutex error code: The mutex locking times out.
140 * Mutex error code: The mutex to be deleted is being locked.
144 * Solution: Delete the mutex after it is unlocked.
167 * Mutex error code: LOS_ERRNO_MUX_MAXNUM_ZERO is zero.
177 * Mutex error code: The API is called in a system-level task, which is forbidden.
186 * @brief Create a mutex.
189 …* This API is used to create a mutex. A mutex handle is assigned to muxHandle when the mutex is cr…
193 …* <li>The total number of mutexes is pre-configured. If there are no available mutexes, the mutex …
196 …* @param muxHandle [OUT] Handle pointer of the successfully created mutex. The value of handle s…
200 * @retval #LOS_ERRNO_MUX_ALL_BUSY No available mutex.
201 * @retval #LOS_OK The mutex is successfully created.
210 * @brief Delete a mutex.
213 …* This API is used to delete a specified mutex. Return LOS_OK on deleting successfully, return spe…
217 * <li>The specific mutex should be created firstly.</li>
218 * <li>The mutex can be deleted successfully only if no other tasks pend on it.</li>
221 * @param muxHandle [IN] Handle of the mutex to be deleted. The value of handle should be in
224 * @retval #LOS_ERRNO_MUX_INVALID Invalid handle or mutex in use.
225 * @retval #LOS_ERRNO_MUX_PENDED Tasks pended on this mutex.
226 * @retval #LOS_OK The mutex is successfully deleted.
235 * @brief Wait to lock a mutex.
238 * This API is used to wait for a specified period of time to lock a mutex.
241 * <li>The specific mutex should be created firstly.</li>
242 …* <li>The function fails if the mutex that is waited on is already locked by another thread when t…
244 * <li>Do not wait on a mutex during an interrupt.</li>
245 …ty inheritance protocol is supported. If a higher-priority thread is waiting on a mutex, it changes
246 * the priority of the thread that owns the mutex to avoid priority inversion.</li>
247 * <li>A recursive mutex can be locked more than once by the same thread.</li>
250 * @param muxHandle [IN] Handle of the mutex to be waited on. The value of handle should be
254 …* @retval #LOS_ERRNO_MUX_INVALID The mutex state (for example, the mutex does not exist…
256 …* @retval #LOS_ERRNO_MUX_UNAVAILABLE The mutex fails to be locked because it is locked by a…
257 * a period of time is not set for waiting for the mutex to become available.
258 * @retval #LOS_ERRNO_MUX_IN_INTERR The mutex is being locked during an interrupt.
259 …* @retval #LOS_ERRNO_MUX_PEND_IN_LOCK The mutex is waited on when the task scheduling is dis…
260 * @retval #LOS_ERRNO_MUX_TIMEOUT The mutex waiting times out.
261 * @retval #LOS_OK The mutex is successfully locked.
270 * @brief Release a mutex.
273 * This API is used to release a specified mutex.
276 * <li>The specific mutex should be created firstly.</li>
277 * <li>Do not release a mutex during an interrupt.</li>
278 …* <li>If a recursive mutex is locked for many times, it must be unlocked for the same times to be …
281 * @param muxHandle [IN] Handle of the mutex to be released. The value of handle should be in
284 …* @retval #LOS_ERRNO_MUX_INVALID The mutex state (for example, the mutex does not exist…
286 * @retval #LOS_ERRNO_MUX_IN_INTERR The mutex is being released during an interrupt.
287 * @retval #LOS_OK The mutex is successfully released.
296 * Mutex object.
300 UINT16 muxCount; /**< Times of locking a mutex */
302 LOS_DL_LIST muxList; /**< Mutex linked list */
303 LosTaskCB *owner; /**< The current thread that is locking a mutex */
307 UINT16 priority; /**< Priority of the thread that is locking a mutex */
312 * Mutex state: not in use.
318 * Mutex state: in use.
326 * Obtain the pointer to a mutex object of the mutex that has a specified handle.
332 * @brief Initializes the mutex.
335 * This API is used to initializes the mutex.
352 * Obtain the pointer to the linked list in the mutex pointed to by a specified pointer.