You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/09/05 01:36:45 UTC

[GitHub] ccollins476ad opened a new pull request #1380: kernel/os: Registration of time-change listeners

ccollins476ad opened a new pull request #1380: kernel/os: Registration of time-change listeners
URL: https://github.com/apache/mynewt-core/pull/1380
 
 
   This PR enables the registration of time-change listeners.  When the time is set via a call to `os_settimeofday()`, all registered listeners are notified.  The following information gets passed to each listener:
   
   ```
   struct os_time_change_info {
       /** UTC time prior to change. */
       const struct os_timeval *tci_prev_tv;
       /** Time zone prior to change. */
       const struct os_timezone *tci_prev_tz;
       /** UTC time after change. */
       const struct os_timeval *tci_cur_tv;
       /** Time zone after change. */
       const struct os_timezone *tci_cur_tz;
       /** True if the time was not set prior to change. */
       bool tci_newly_synced;
   };
   ```
   
   plus an optional listener-specific `void *arg`.
   
   As indicated in the doxygen comments, the listener registration and removal functions are not thread safe.  In the typical case, I expect listeners to get added at startup and never removed, so I didn't think adding thread-safety was justified.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services