* @brief Enqueue a task request (Linux implementation) * * Thread-safe enqueue operation using std::mutex. * Simulates FreeRTOS queue behavior for Linux testing. * * @param req Pointer to the request structure * @return true if enqueued successfully, false if queue is full */
| 40 | * @return true if enqueued successfully, false if queue is full |
| 41 | */ |
| 42 | bool _task_enqueue_request(_task_request_t* req) { |
| 43 | std::unique_lock<std::mutex> lock(queueMutex); |
| 44 | |
| 45 | // Check queue size limit |
| 46 | if (taskRequestQueue.size() >= MAX_QUEUE_SIZE) { |
| 47 | return false; // Queue full |
| 48 | } |
| 49 | |
| 50 | // Add request to queue |
| 51 | taskRequestQueue.push(*req); |
| 52 | |
| 53 | // Notify waiting threads |
| 54 | queueCV.notify_one(); |
| 55 | |
| 56 | return true; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @brief Dequeue a task request (Linux implementation) |