MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_data_queue_deinit

Function rt_data_queue_deinit

components/drivers/ipc/dataqueue.c:405–422  ·  view source on GitHub ↗

* @brief This function will deinit the data queue. * * @param queue is a pointer to the data queue object. * * @return Return the operation status. When the return value is RT_EOK, the operation is successful. */

Source from the content-addressed store, hash-verified

403 * @return Return the operation status. When the return value is RT_EOK, the operation is successful.
404 */
405rt_err_t rt_data_queue_deinit(struct rt_data_queue *queue)
406{
407 rt_base_t level;
408
409 RT_ASSERT(queue != RT_NULL);
410 RT_ASSERT(queue->magic == DATAQUEUE_MAGIC);
411
412 /* wakeup all suspend threads */
413 rt_data_queue_reset(queue);
414
415 level = rt_spin_lock_irqsave(&(queue->spinlock));
416 queue->magic = 0;
417 rt_spin_unlock_irqrestore(&(queue->spinlock), level);
418
419 rt_free(queue->queue);
420
421 return RT_EOK;
422}
423RTM_EXPORT(rt_data_queue_deinit);
424
425/**

Callers 1

ifFunction · 0.85

Calls 4

rt_data_queue_resetFunction · 0.85
rt_freeFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.50

Tested by

no test coverage detected