You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/11 04:28:02 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #1023: Fix setlogmask() not to use enter_critical_section() in protected build

xiaoxiang781216 commented on a change in pull request #1023:
URL: https://github.com/apache/incubator-nuttx/pull/1023#discussion_r422773452



##########
File path: libs/libc/syslog/lib_setlogmask.c
##########
@@ -91,17 +96,29 @@ uint8_t g_syslog_mask = LOG_ALL;
 int setlogmask(int mask)
 {
   uint8_t oldmask;
+
+#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)

Review comment:
       The better fix is either:
   1.remove the critical section or
   2.replace with mutex/semphare
   The mix just make the logic more complex and unmaintainable




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org