forked from nuttx/nuttx-update
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
1 changed files with 3 additions and 2 deletions
|
@ -249,6 +249,7 @@ int syslog_add_intbuffer(int ch)
|
||||||
int syslog_flush_intbuffer(bool force)
|
int syslog_flush_intbuffer(bool force)
|
||||||
{
|
{
|
||||||
syslog_putc_t putfunc;
|
syslog_putc_t putfunc;
|
||||||
|
irqstate_t flags;
|
||||||
int ch;
|
int ch;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -256,7 +257,7 @@ int syslog_flush_intbuffer(bool force)
|
||||||
* concurrent modification by other tasks.
|
* concurrent modification by other tasks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sched_lock();
|
flags = enter_critical_section();
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -293,7 +294,7 @@ int syslog_flush_intbuffer(bool force)
|
||||||
}
|
}
|
||||||
while (ch != EOF);
|
while (ch != EOF);
|
||||||
|
|
||||||
sched_unlock();
|
leave_critical_section(flags);
|
||||||
|
|
||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue