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 2021/08/03 06:33:01 UTC

[GitHub] [incubator-nuttx] Donny9 commented on a change in pull request #4270: tzset: avoid taking semaphore in interrupt for non-kernel mode

Donny9 commented on a change in pull request #4270:
URL: https://github.com/apache/incubator-nuttx/pull/4270#discussion_r681473001



##########
File path: libs/libc/time/lib_localtime.c
##########
@@ -2528,9 +2537,20 @@ void tzset(void)
 {
   FAR const char *name;
 
-  tz_semtake(&g_lcl_sem);
-
   name = getenv("TZ");
+  if (g_lcl_isset > 0 && name && strcmp(g_lcl_tzname, name) == 0)
+    {
+      return;
+    }

Review comment:
       > required
   
   Because we use global var(g_lcl_isset and g_lcl_tzname) without taking semaphore, and when we access them again, they have changed, so we need this condition again.




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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