mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 18:57:16 +08:00
add RT_DEBUG_SCHEDULER_AVAILABLE check
This commit is contained in:
@@ -98,6 +98,12 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue,
|
||||
RT_ASSERT(queue != RT_NULL);
|
||||
RT_ASSERT(queue->magic == DATAQUEUE_MAGIC);
|
||||
|
||||
/* current context checking */
|
||||
if (timeout != 0)
|
||||
{
|
||||
RT_DEBUG_SCHEDULER_AVAILABLE;
|
||||
}
|
||||
|
||||
result = RT_EOK;
|
||||
thread = rt_thread_self();
|
||||
|
||||
@@ -112,9 +118,6 @@ rt_err_t rt_data_queue_push(struct rt_data_queue *queue,
|
||||
goto __exit;
|
||||
}
|
||||
|
||||
/* current context checking */
|
||||
RT_DEBUG_NOT_IN_INTERRUPT;
|
||||
|
||||
/* reset thread error number */
|
||||
thread->error = RT_EOK;
|
||||
|
||||
@@ -217,6 +220,12 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
|
||||
RT_ASSERT(data_ptr != RT_NULL);
|
||||
RT_ASSERT(size != RT_NULL);
|
||||
|
||||
/* current context checking */
|
||||
if (timeout != 0)
|
||||
{
|
||||
RT_DEBUG_SCHEDULER_AVAILABLE;
|
||||
}
|
||||
|
||||
result = RT_EOK;
|
||||
thread = rt_thread_self();
|
||||
|
||||
@@ -230,9 +239,6 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
|
||||
goto __exit;
|
||||
}
|
||||
|
||||
/* current context checking */
|
||||
RT_DEBUG_NOT_IN_INTERRUPT;
|
||||
|
||||
/* reset thread error number */
|
||||
thread->error = RT_EOK;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user