diff --git a/drivers/syslog/syslog_intbuffer.c b/drivers/syslog/syslog_intbuffer.c index 6347e179f0179..cdff96df3a043 100644 --- a/drivers/syslog/syslog_intbuffer.c +++ b/drivers/syslog/syslog_intbuffer.c @@ -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; } diff --git a/sched/misc/assert.c b/sched/misc/assert.c index 0079014782765..343a042f76952 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -536,8 +536,6 @@ void _assert(FAR const char *filename, int linenum, flags = enter_critical_section(); - sched_lock(); - /* try to save current context if regs is null */ if (regs == NULL) @@ -672,7 +670,5 @@ void _assert(FAR const char *filename, int linenum, #endif } - sched_unlock(); - leave_critical_section(flags); }