Skip to content

Commit b5d1b97

Browse files
authored
Update stream and message buffer documentation (#1226)
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
1 parent a585796 commit b5d1b97

File tree

2 files changed

+54
-54
lines changed

2 files changed

+54
-54
lines changed

include/message_buffer.h

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@
4343
* writer and reader to be different tasks or interrupts, but, unlike other
4444
* FreeRTOS objects, it is not safe to have multiple different writers or
4545
* multiple different readers. If there are to be multiple different writers
46-
* then the application writer must place each call to a writing API function
47-
* (such as xMessageBufferSend()) inside a critical section and set the send
48-
* block time to 0. Likewise, if there are to be multiple different readers
49-
* then the application writer must place each call to a reading API function
50-
* (such as xMessageBufferRead()) inside a critical section and set the receive
51-
* timeout to 0.
46+
* then the application writer must serialize calls to writing API functions
47+
* (such as xStreamBufferSend()). Likewise, if there are to be multiple
48+
* different readers then the application writer must serialize calls to reading
49+
* API functions (such as xStreamBufferReceive()). One way to achieve such
50+
* serialization in single core or SMP kernel is to place each API call inside a
51+
* critical section and use a block time of 0.
5252
*
5353
* Message buffers hold variable length messages. To enable that, when a
5454
* message is written to the message buffer an additional sizeof( size_t ) bytes
@@ -306,12 +306,12 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
306306
* writer and reader to be different tasks or interrupts, but, unlike other
307307
* FreeRTOS objects, it is not safe to have multiple different writers or
308308
* multiple different readers. If there are to be multiple different writers
309-
* then the application writer must place each call to a writing API function
310-
* (such as xMessageBufferSend()) inside a critical section and set the send
311-
* block time to 0. Likewise, if there are to be multiple different readers
312-
* then the application writer must place each call to a reading API function
313-
* (such as xMessageBufferRead()) inside a critical section and set the receive
314-
* block time to 0.
309+
* then the application writer must serialize calls to writing API functions
310+
* (such as xStreamBufferSend()). Likewise, if there are to be multiple
311+
* different readers then the application writer must serialize calls to reading
312+
* API functions (such as xStreamBufferReceive()). One way to achieve such
313+
* serialization in single core or SMP kernel is to place each API call inside a
314+
* critical section and use a block time of 0.
315315
*
316316
* Use xMessageBufferSend() to write to a message buffer from a task. Use
317317
* xMessageBufferSendFromISR() to write to a message buffer from an interrupt
@@ -409,12 +409,12 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
409409
* writer and reader to be different tasks or interrupts, but, unlike other
410410
* FreeRTOS objects, it is not safe to have multiple different writers or
411411
* multiple different readers. If there are to be multiple different writers
412-
* then the application writer must place each call to a writing API function
413-
* (such as xMessageBufferSend()) inside a critical section and set the send
414-
* block time to 0. Likewise, if there are to be multiple different readers
415-
* then the application writer must place each call to a reading API function
416-
* (such as xMessageBufferRead()) inside a critical section and set the receive
417-
* block time to 0.
412+
* then the application writer must serialize calls to writing API functions
413+
* (such as xStreamBufferSend()). Likewise, if there are to be multiple
414+
* different readers then the application writer must serialize calls to reading
415+
* API functions (such as xStreamBufferReceive()). One way to achieve such
416+
* serialization in single core or SMP kernel is to place each API call inside a
417+
* critical section and use a block time of 0.
418418
*
419419
* Use xMessageBufferSend() to write to a message buffer from a task. Use
420420
* xMessageBufferSendFromISR() to write to a message buffer from an interrupt
@@ -516,12 +516,12 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
516516
* writer and reader to be different tasks or interrupts, but, unlike other
517517
* FreeRTOS objects, it is not safe to have multiple different writers or
518518
* multiple different readers. If there are to be multiple different writers
519-
* then the application writer must place each call to a writing API function
520-
* (such as xMessageBufferSend()) inside a critical section and set the send
521-
* block time to 0. Likewise, if there are to be multiple different readers
522-
* then the application writer must place each call to a reading API function
523-
* (such as xMessageBufferRead()) inside a critical section and set the receive
524-
* block time to 0.
519+
* then the application writer must serialize calls to writing API functions
520+
* (such as xStreamBufferSend()). Likewise, if there are to be multiple
521+
* different readers then the application writer must serialize calls to reading
522+
* API functions (such as xStreamBufferReceive()). One way to achieve such
523+
* serialization in single core or SMP kernel is to place each API call inside a
524+
* critical section and use a block time of 0.
525525
*
526526
* Use xMessageBufferReceive() to read from a message buffer from a task. Use
527527
* xMessageBufferReceiveFromISR() to read from a message buffer from an
@@ -610,12 +610,12 @@ typedef StreamBufferHandle_t MessageBufferHandle_t;
610610
* writer and reader to be different tasks or interrupts, but, unlike other
611611
* FreeRTOS objects, it is not safe to have multiple different writers or
612612
* multiple different readers. If there are to be multiple different writers
613-
* then the application writer must place each call to a writing API function
614-
* (such as xMessageBufferSend()) inside a critical section and set the send
615-
* block time to 0. Likewise, if there are to be multiple different readers
616-
* then the application writer must place each call to a reading API function
617-
* (such as xMessageBufferRead()) inside a critical section and set the receive
618-
* block time to 0.
613+
* then the application writer must serialize calls to writing API functions
614+
* (such as xStreamBufferSend()). Likewise, if there are to be multiple
615+
* different readers then the application writer must serialize calls to reading
616+
* API functions (such as xStreamBufferReceive()). One way to achieve such
617+
* serialization in single core or SMP kernel is to place each API call inside a
618+
* critical section and use a block time of 0.
619619
*
620620
* Use xMessageBufferReceive() to read from a message buffer from a task. Use
621621
* xMessageBufferReceiveFromISR() to read from a message buffer from an

include/stream_buffer.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
* writer and reader to be different tasks or interrupts, but, unlike other
4141
* FreeRTOS objects, it is not safe to have multiple different writers or
4242
* multiple different readers. If there are to be multiple different writers
43-
* then the application writer must place each call to a writing API function
44-
* (such as xStreamBufferSend()) inside a critical section and set the send
45-
* block time to 0. Likewise, if there are to be multiple different readers
46-
* then the application writer must place each call to a reading API function
47-
* (such as xStreamBufferReceive()) inside a critical section section and set the
48-
* receive block time to 0.
43+
* then the application writer must serialize calls to writing API functions
44+
* (such as xStreamBufferSend()). Likewise, if there are to be multiple
45+
* different readers then the application writer must serialize calls to reading
46+
* API functions (such as xStreamBufferReceive()). One way to achieve such
47+
* serialization in single core or SMP kernel is to place each API call inside a
48+
* critical section and use a block time of 0.
4949
*
5050
*/
5151

@@ -514,12 +514,12 @@ typedef void (* StreamBufferCallbackFunction_t)( StreamBufferHandle_t xStreamBuf
514514
* writer and reader to be different tasks or interrupts, but, unlike other
515515
* FreeRTOS objects, it is not safe to have multiple different writers or
516516
* multiple different readers. If there are to be multiple different writers
517-
* then the application writer must place each call to a writing API function
518-
* (such as xStreamBufferSend()) inside a critical section and set the send
519-
* block time to 0. Likewise, if there are to be multiple different readers
520-
* then the application writer must place each call to a reading API function
521-
* (such as xStreamBufferReceive()) inside a critical section and set the receive
522-
* block time to 0.
517+
* then the application writer must serialize calls to writing API functions
518+
* (such as xStreamBufferSend()). Likewise, if there are to be multiple
519+
* different readers then the application writer must serialize calls to reading
520+
* API functions (such as xStreamBufferReceive()). One way to achieve such
521+
* serialization in single core or SMP kernel is to place each API call inside a
522+
* critical section and use a block time of 0.
523523
*
524524
* Use xStreamBufferSend() to write to a stream buffer from a task. Use
525525
* xStreamBufferSendFromISR() to write to a stream buffer from an interrupt
@@ -615,12 +615,12 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
615615
* writer and reader to be different tasks or interrupts, but, unlike other
616616
* FreeRTOS objects, it is not safe to have multiple different writers or
617617
* multiple different readers. If there are to be multiple different writers
618-
* then the application writer must place each call to a writing API function
619-
* (such as xStreamBufferSend()) inside a critical section and set the send
620-
* block time to 0. Likewise, if there are to be multiple different readers
621-
* then the application writer must place each call to a reading API function
622-
* (such as xStreamBufferReceive()) inside a critical section and set the receive
623-
* block time to 0.
618+
* then the application writer must serialize calls to writing API functions
619+
* (such as xStreamBufferSend()). Likewise, if there are to be multiple
620+
* different readers then the application writer must serialize calls to reading
621+
* API functions (such as xStreamBufferReceive()). One way to achieve such
622+
* serialization in single core or SMP kernel is to place each API call inside a
623+
* critical section and use a block time of 0.
624624
*
625625
* Use xStreamBufferSend() to write to a stream buffer from a task. Use
626626
* xStreamBufferSendFromISR() to write to a stream buffer from an interrupt
@@ -718,12 +718,12 @@ size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
718718
* writer and reader to be different tasks or interrupts, but, unlike other
719719
* FreeRTOS objects, it is not safe to have multiple different writers or
720720
* multiple different readers. If there are to be multiple different writers
721-
* then the application writer must place each call to a writing API function
722-
* (such as xStreamBufferSend()) inside a critical section and set the send
723-
* block time to 0. Likewise, if there are to be multiple different readers
724-
* then the application writer must place each call to a reading API function
725-
* (such as xStreamBufferReceive()) inside a critical section and set the receive
726-
* block time to 0.
721+
* then the application writer must serialize calls to writing API functions
722+
* (such as xStreamBufferSend()). Likewise, if there are to be multiple
723+
* different readers then the application writer must serialize calls to reading
724+
* API functions (such as xStreamBufferReceive()). One way to achieve such
725+
* serialization in single core or SMP kernel is to place each API call inside a
726+
* critical section and use a block time of 0.
727727
*
728728
* Use xStreamBufferReceive() to read from a stream buffer from a task. Use
729729
* xStreamBufferReceiveFromISR() to read from a stream buffer from an

0 commit comments

Comments
 (0)