summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorarmink <[email protected]>2016-10-31 08:39:49 +0800
committerarmink <[email protected]>2016-10-31 14:47:48 +0800
commit0970cf03a4db015d988b4e3fea6bc80f50394ef0 (patch)
treef06b05ec9b6f2f4afca5f90dae26aa7b23adbe6b /components
parentbda654330567a62695ae365b56d31512ba301ad3 (diff)
[DeviceDrivers]Reset dataqueue waiting_lwm flag when suspended_push_list is empty
Diffstat (limited to 'components')
-rw-r--r--components/drivers/src/dataqueue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/drivers/src/dataqueue.c b/components/drivers/src/dataqueue.c
index dc265fb66d..1d458eec81 100644
--- a/components/drivers/src/dataqueue.c
+++ b/components/drivers/src/dataqueue.c
@@ -20,6 +20,7 @@
* Change Logs:
* Date Author Notes
* 2012-09-30 Bernard first version.
+ * 2016-10-31 armink fix some resume push and pop thread bugs
*/
#include <rtthread.h>
@@ -220,8 +221,6 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
if ((queue->waiting_lwm == RT_TRUE) &&
(queue->put_index - queue->get_index) <= queue->lwm)
{
- queue->waiting_lwm = RT_FALSE;
-
/*
* there is at least one thread in suspended list
* and less than low water mark
@@ -242,6 +241,7 @@ rt_err_t rt_data_queue_pop(struct rt_data_queue *queue,
}
else
{
+ queue->waiting_lwm = RT_FALSE;
rt_hw_interrupt_enable(level);
}