mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 18:58:27 +08:00
Squashed commit of the following:
sched/semaphore: Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable. Changed all references to sem_post in the OS to nxsem_post().
sched/semaphore: Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable. Changed all references to sem_destroy() in the OS to nxsem_destroy().
libc/semaphore and sched/semaphore: Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable. Changed all references to sem_setprotocol in the OS to nxsem_setprotocol(). sem_getprotocol() was not used in the OS
This commit is contained in:
@@ -95,7 +95,7 @@ int pthread_barrier_init(FAR pthread_barrier_t *barrier,
|
||||
}
|
||||
else
|
||||
{
|
||||
nxsem_init(&barrier->sem, 0, 0);
|
||||
sem_init(&barrier->sem, 0, 0);
|
||||
barrier->count = count;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ int pthread_barrier_wait(FAR pthread_barrier_t *barrier)
|
||||
|
||||
/* Find out how many threads are already waiting at the barrier */
|
||||
|
||||
ret = nxsem_getvalue(&barrier->sem, &semcount);
|
||||
ret = sem_getvalue(&barrier->sem, &semcount);
|
||||
if (ret != OK)
|
||||
{
|
||||
sched_unlock();
|
||||
@@ -125,7 +125,7 @@ int pthread_barrier_wait(FAR pthread_barrier_t *barrier)
|
||||
while (semcount < 0)
|
||||
{
|
||||
(void)sem_post(&barrier->sem);
|
||||
(void)nxsem_getvalue(&barrier->sem, &semcount);
|
||||
(void)sem_getvalue(&barrier->sem, &semcount);
|
||||
}
|
||||
|
||||
/* Then return PTHREAD_BARRIER_SERIAL_THREAD to the final thread */
|
||||
|
||||
@@ -81,7 +81,7 @@ int pthread_cond_init(FAR pthread_cond_t *cond, FAR const pthread_condattr_t *at
|
||||
* initial count = 0
|
||||
*/
|
||||
|
||||
else if (nxsem_init((FAR sem_t *)&cond->sem, 0, 0) != OK)
|
||||
else if (sem_init((FAR sem_t *)&cond->sem, 0, 0) != OK)
|
||||
{
|
||||
ret = EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user