[DFS] Add protection for pt->triggered

This commit is contained in:
Bernard Xiong 2018-03-09 08:35:12 +08:00
parent fe66f24c69
commit eb78535604
1 changed files with 4 additions and 4 deletions

View File

@ -20,6 +20,7 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2016-12-28 Bernard first version * 2016-12-28 Bernard first version
* 2018-03-09 Bernard Add protection for pt->triggered.
*/ */
#include <stdint.h> #include <stdint.h>
@ -118,13 +119,12 @@ static int poll_wait_timeout(struct rt_poll_table *pt, int msec)
rt_hw_interrupt_enable(level); rt_hw_interrupt_enable(level);
rt_schedule(); rt_schedule();
}
else level = rt_hw_interrupt_disable();
{
rt_hw_interrupt_enable(level);
} }
ret = !pt->triggered; ret = !pt->triggered;
rt_hw_interrupt_enable(level);
return ret; return ret;
} }