Lines Matching +full:int +full:- +full:a

5  * SPDX-License-Identifier: Apache-2.0
37 * We reserve the MSB to mark a pthread_mutex_t as initialized (from the
38 * perspective of the application). With a linear space, this means that
46 return m - posix_mutex_pool; in posix_mutex_to_offset()
56 int actually_initialized; in get_posix_mutex()
82 int err; in to_posix_mutex()
90 /* Try and automatically associate a posix_mutex */ in to_posix_mutex()
108 static int acquire_mutex(pthread_mutex_t *mu, k_timeout_t timeout) in acquire_mutex()
110 int type = -1; in acquire_mutex()
111 size_t bit = -1; in acquire_mutex()
112 int ret = EINVAL; in acquire_mutex()
113 size_t lock_count = -1; in acquire_mutex()
129 owner = m->owner; in acquire_mutex()
130 lock_count = m->lock_count; in acquire_mutex()
146 LOG_DBG("Attempt to relock non-recursive mutex %p", m); in acquire_mutex()
159 LOG_DBG("Attempt to recursively lock non-recursive mutex %p", m); in acquire_mutex()
171 if (ret == -EAGAIN) { in acquire_mutex()
174 * special quirk - k_mutex_lock() returns EAGAIN if a timeout occurs, but in acquire_mutex()
184 ret = -ret; in acquire_mutex()
195 * @brief Lock POSIX mutex with non-blocking call.
199 int pthread_mutex_trylock(pthread_mutex_t *m) in pthread_mutex_trylock()
210 int pthread_mutex_timedlock(pthread_mutex_t *m, in pthread_mutex_timedlock()
222 int pthread_mutex_init(pthread_mutex_t *mu, const pthread_mutexattr_t *_attr) in pthread_mutex_init()
239 posix_mutex_type[bit] = attr->type; in pthread_mutex_init()
253 int pthread_mutex_lock(pthread_mutex_t *m) in pthread_mutex_lock()
263 int pthread_mutex_unlock(pthread_mutex_t *mu) in pthread_mutex_unlock()
265 int ret; in pthread_mutex_unlock()
276 return -ret; in pthread_mutex_unlock()
290 int pthread_mutex_destroy(pthread_mutex_t *mu) in pthread_mutex_destroy()
292 int err; in pthread_mutex_destroy()
315 int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr, in pthread_mutexattr_getprotocol()
316 int *protocol) in pthread_mutexattr_getprotocol()
331 int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol) in pthread_mutexattr_setprotocol()
349 int pthread_mutexattr_init(pthread_mutexattr_t *attr) in pthread_mutexattr_init()
351 struct pthread_mutexattr *const a = (struct pthread_mutexattr *)attr; in pthread_mutexattr_init() local
353 if (a == NULL) { in pthread_mutexattr_init()
357 a->type = PTHREAD_MUTEX_DEFAULT; in pthread_mutexattr_init()
358 a->initialized = true; in pthread_mutexattr_init()
363 int pthread_mutexattr_destroy(pthread_mutexattr_t *attr) in pthread_mutexattr_destroy()
365 struct pthread_mutexattr *const a = (struct pthread_mutexattr *)attr; in pthread_mutexattr_destroy() local
367 if (a == NULL || !a->initialized) { in pthread_mutexattr_destroy()
371 *a = (struct pthread_mutexattr){0}; in pthread_mutexattr_destroy()
381 int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type) in pthread_mutexattr_gettype()
383 const struct pthread_mutexattr *a = (const struct pthread_mutexattr *)attr; in pthread_mutexattr_gettype() local
385 if (a == NULL || type == NULL || !a->initialized) { in pthread_mutexattr_gettype()
389 *type = a->type; in pthread_mutexattr_gettype()
399 int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) in pthread_mutexattr_settype()
401 struct pthread_mutexattr *const a = (struct pthread_mutexattr *)attr; in pthread_mutexattr_settype() local
403 if (a == NULL || !a->initialized) { in pthread_mutexattr_settype()
411 a->type = type; in pthread_mutexattr_settype()
419 int pthread_mutex_getprioceiling(const pthread_mutex_t *mutex, int *prioceiling) in pthread_mutex_getprioceiling()
427 int pthread_mutex_setprioceiling(pthread_mutex_t *mutex, int prioceiling, int *old_ceiling) in pthread_mutex_setprioceiling()
436 int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr, int *prioceiling) in pthread_mutexattr_getprioceiling()
444 int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, int prioceiling) in pthread_mutexattr_setprioceiling()
454 static int pthread_mutex_pool_init(void) in pthread_mutex_pool_init()
456 int err; in pthread_mutex_pool_init()