mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 04:35:25 -06:00
PriorityQueue Send mark as unsafe for ISR (#3216)
* Updated comment to indicate functions are not ISR safe since they use a mutex under the hood * added another needed comment * Adding warning on priorityqueue usage within an ISR
This commit is contained in:
parent
c98d947543
commit
a2a0f39e99
@ -47,6 +47,8 @@ struct PriorityQueueHandle : public QueueHandle {
|
||||
};
|
||||
//! \brief generic priority queue implementation
|
||||
//!
|
||||
//! \warning This Priority Queue is not ISR safe
|
||||
//!
|
||||
//! A generic implementation of a priority queue to support the Os::QueueInterface. This queue uses OSAL mutexes,
|
||||
//! and condition variables to provide for a task-safe blocking queue implementation. Data is stored in heap memory.
|
||||
//!
|
||||
@ -88,6 +90,7 @@ class PriorityQueue : public Os::QueueInterface {
|
||||
//!
|
||||
//! \warning It is invalid to send a null buffer
|
||||
//! \warning This method will block if the queue is full and blockType is set to BLOCKING
|
||||
//! \warning This method is not ISR safe
|
||||
//!
|
||||
//! \param buffer: message data
|
||||
//! \param size: size of message data
|
||||
@ -124,6 +127,8 @@ class PriorityQueue : public Os::QueueInterface {
|
||||
|
||||
//! \brief get maximum messages stored at any given time
|
||||
//!
|
||||
//! \warning This method is not ISR safe
|
||||
//!
|
||||
//! Returns the maximum number of messages in this queue at any given time. This is the high-water mark for this
|
||||
//! queue.
|
||||
//! \return queue message high-water mark
|
||||
|
||||
@ -12,6 +12,9 @@ Os::PriorityQueue is an in-memory implementation of Os::Queue. It allows project
|
||||
|
||||
For memory protection, Os::PriorityQueue delegates to Os::Mutex and Os::ConditionVariable.
|
||||
|
||||
> [!WARNING]
|
||||
> This Queue implementation is insufficient to be used for sending messages in ISR context due to the use of Os::Mutex as mentioned in above.
|
||||
|
||||
### Os::PriorityQueue Key Algorithms
|
||||
|
||||
Os::PriorityQueue stores messages in a set of dynamically allocated unordered parallel arrays. These arrays store: message data, and message data size respectively. There is also an index-free list that stores the indices that are available for storage in the fixed size arrays.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user