drivers: syslog: Replace sched_lock with critical section in syslog_flush_intbuffer()
Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
parent
3739a233b7
commit
72548951d3
@ -249,6 +249,7 @@ int syslog_add_intbuffer(int ch)
|
||||
int syslog_flush_intbuffer(bool force)
|
||||
{
|
||||
syslog_putc_t putfunc;
|
||||
irqstate_t flags;
|
||||
int ch;
|
||||
int i;
|
||||
|
||||
@ -256,7 +257,7 @@ int syslog_flush_intbuffer(bool force)
|
||||
* concurrent modification by other tasks.
|
||||
*/
|
||||
|
||||
sched_lock();
|
||||
flags = enter_critical_section();
|
||||
|
||||
do
|
||||
{
|
||||
@ -293,7 +294,7 @@ int syslog_flush_intbuffer(bool force)
|
||||
}
|
||||
while (ch != EOF);
|
||||
|
||||
sched_unlock();
|
||||
leave_critical_section(flags);
|
||||
|
||||
return ch;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user