Update some comments

This commit is contained in:
Gregory Nutt
2016-03-06 13:50:26 -06:00
parent 5d63cd85c7
commit 9b5e88af71
5 changed files with 14 additions and 10 deletions
+1 -1
Submodule arch updated: 0b8fe68bf5...7ce734b33c
+1 -1
Submodule configs updated: 0c764446fe...3783532d6d
+4 -2
View File
@@ -117,8 +117,10 @@ int sem_tickwait(FAR sem_t *sem, systime_t start, uint32_t delay);
* Name: sem_reset * Name: sem_reset
* *
* Description: * Description:
* Reset a semaphore to a specific value. This kind of operation is * Reset a semaphore count to a specific value. This is similar to part
* sometimes required for certain error handling conditions. * of the operation of sem_init(). But sem_reset() may need to wake up
* tasks waiting on a count. This kind of operation is sometimes required
* within the OS (only) for certain error handling conditions.
* *
* Parameters: * Parameters:
* sem - Semaphore descriptor to be reset * sem - Semaphore descriptor to be reset
+1 -1
View File
@@ -85,7 +85,7 @@ struct semholder_s
struct sem_s struct sem_s
{ {
int16_t semcount; /* >0 -> Num counts available */ volatile int16_t semcount; /* >0 -> Num counts available */
/* <0 -> Num tasks waiting for semaphore */ /* <0 -> Num tasks waiting for semaphore */
/* If priority inheritance is enabled, then we have to keep track of which /* If priority inheritance is enabled, then we have to keep track of which
* tasks hold references to the semaphore. * tasks hold references to the semaphore.
+7 -5
View File
@@ -55,8 +55,10 @@
* Name: sem_reset * Name: sem_reset
* *
* Description: * Description:
* Reset a semaphore to a specific value. This kind of operation is * Reset a semaphore count to a specific value. This is similar to part
* sometimes required for certain error handling conditions. * of the operation of sem_init(). But sem_reset() may need to wake up
* tasks waiting on a count. This kind of operation is sometimes required
* within the OS (only) for certain error handling conditions.
* *
* Parameters: * Parameters:
* sem - Semaphore descriptor to be reset * sem - Semaphore descriptor to be reset
@@ -74,7 +76,7 @@ int sem_reset(FAR sem_t *sem, int16_t count)
DEBUGASSERT(sem != NULL && count >= 0); DEBUGASSERT(sem != NULL && count >= 0);
/* Don't allow any context switches that may result from the following /* Don't allow any context switches that may result from the following
* sem_post operations. * sem_post() operations.
*/ */
sched_lock(); sched_lock();
@@ -85,7 +87,7 @@ int sem_reset(FAR sem_t *sem, int16_t count)
flags = enter_critical_section(); flags = enter_critical_section();
/* A negative count indicates the negated number of threads that are /* A negative count indicates that the negated number of threads are
* waiting to take a count from the semaphore. Loop here, handing * waiting to take a count from the semaphore. Loop here, handing
* out counts to any waiting threads. * out counts to any waiting threads.
*/ */
@@ -105,7 +107,7 @@ int sem_reset(FAR sem_t *sem, int16_t count)
* (i.e., with sem->semcount >= 0). In this case, 'count' holds the * (i.e., with sem->semcount >= 0). In this case, 'count' holds the
* the new value of the semaphore count. OR (2) with threads still * the new value of the semaphore count. OR (2) with threads still
* waiting but all of the semaphore counts exhausted: The current * waiting but all of the semaphore counts exhausted: The current
* value of sem->semcount is correct. * value of sem->semcount is already correct in this case.
*/ */
if (sem->semcount >= 0) if (sem->semcount >= 0)