diff options
| author | guo <[email protected]> | 2022-01-28 16:38:32 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-28 16:38:32 +0800 |
| commit | 580194f5f0f18371c08bb926a8fed7d7093cea67 (patch) | |
| tree | 17b0dac3ea40283f1b9268a56f3577c9d3e94d05 /components/drivers | |
| parent | cd929f04f680ea243810c988558c717c193740b8 (diff) | |
| parent | 500d26c2570bb3d905e38aed05fd9c9b324a8f6e (diff) | |
Merge pull request #4740 from Guozhanxin/scheduler_check
Diffstat (limited to 'components/drivers')
| -rw-r--r-- | components/drivers/ipc/completion.c | 6 | ||||
| -rw-r--r-- | components/drivers/ipc/dataqueue.c | 12 | ||||
| -rw-r--r-- | components/drivers/ipc/waitqueue.c | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/components/drivers/ipc/completion.c b/components/drivers/ipc/completion.c index f13718f9b3..84dfb740b1 100644 --- a/components/drivers/ipc/completion.c +++ b/components/drivers/ipc/completion.c @@ -57,6 +57,9 @@ rt_err_t rt_completion_wait(struct rt_completion *completion, rt_thread_t thread; RT_ASSERT(completion != RT_NULL); + /* current context checking */ + RT_DEBUG_SCHEDULER_AVAILABLE(timeout != 0); + result = RT_EOK; thread = rt_thread_self(); @@ -82,9 +85,6 @@ rt_err_t rt_completion_wait(struct rt_completion *completion, rt_list_insert_before(&(completion->suspended_list), &(thread->tlist)); - /* current context checking */ - RT_DEBUG_NOT_IN_INTERRUPT; - /* start timer */ if (timeout > 0) { diff --git a/components/drivers/ipc/dataqueue.c b/components/drivers/ipc/dataqueue.c index 4e52662c44..94e7b087c5 100644 --- a/components/drivers/ipc/dataqueue.c +++ b/components/drivers/ipc/dataqueue.c @@ -98,6 +98,9 @@ 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 */ + RT_DEBUG_SCHEDULER_AVAILABLE(timeout != 0); + result = RT_EOK; thread = rt_thread_self(); @@ -112,9 +115,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 +217,9 @@ 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 */ + RT_DEBUG_SCHEDULER_AVAILABLE(timeout != 0); + result = RT_EOK; thread = rt_thread_self(); @@ -230,9 +233,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; diff --git a/components/drivers/ipc/waitqueue.c b/components/drivers/ipc/waitqueue.c index 6a26604617..7847c6dde2 100644 --- a/components/drivers/ipc/waitqueue.c +++ b/components/drivers/ipc/waitqueue.c @@ -129,7 +129,7 @@ int rt_wqueue_wait(rt_wqueue_t *queue, int condition, int msec) rt_base_t level; /* current context checking */ - RT_DEBUG_NOT_IN_INTERRUPT; + RT_DEBUG_SCHEDULER_AVAILABLE(RT_TRUE); tick = rt_tick_from_millisecond(msec); |
