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



##########
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
   
   A pthread mutex cannot be across task groups (or at least should not because 
it breaks the usaage model).  "pshared" semaphores (only) would be okay but 
would probably need to created via sem_open().
   
   Test and set could probably also be used but is not available in all 
architectures.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to