Skip to content

Commit 29b202a

Browse files
list.c: improve code comments to point to official documentation about problems which may cause code to get stuck inside of list.c (FreeRTOS#1051)
list.c: improve documentation about initializing binary semaphores
1 parent 55eceb2 commit 29b202a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

list.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,24 @@ void vListInsert( List_t * const pxList,
184184
* 4) Using a queue or semaphore before it has been initialised or
185185
* before the scheduler has been started (are interrupts firing
186186
* before vTaskStartScheduler() has been called?).
187-
* 5) If the FreeRTOS port supports interrupt nesting then ensure that
187+
* 5) Attempting to 'take' binary semaphores created using
188+
* `xSemaphoreCreateBinary()` or `xSemaphoreCreateBinaryStatic()`
189+
* APIs, before 'giving' them. Binary semaphores created using
190+
* `xSemaphoreCreateBinary()` or `xSemaphoreCreateBinaryStatic()`,
191+
* are created in a state such that the semaphore must first be
192+
* 'given' using xSemaphoreGive() API before it can be 'taken' using
193+
* xSemaphoreTake() API.
194+
* 6) If the FreeRTOS port supports interrupt nesting then ensure that
188195
* the priority of the tick interrupt is at or below
189196
* configMAX_SYSCALL_INTERRUPT_PRIORITY.
190197
**********************************************************************/
191198

192199
for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext )
193200
{
194201
/* There is nothing to do here, just iterating to the wanted
195-
* insertion position. */
202+
* insertion position.
203+
* IF YOU FIND YOUR CODE STUCK HERE, SEE THE NOTE JUST ABOVE.
204+
*/
196205
}
197206
}
198207

0 commit comments

Comments
 (0)