summaryrefslogtreecommitdiff
path: root/ntpshm.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-29 09:27:11 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-29 09:28:05 -0400
commit136a7eecf78cee3bbf8a8e7932e1f315320837a3 (patch)
tree7babf4d0494c10de404091571f5279de33715261 /ntpshm.c
parent2f5680e7e40a701d66abf020a7b3ecee44efb97c (diff)
downloadgpsd-136a7eecf78cee3bbf8a8e7932e1f315320837a3.tar.gz
Now we can handle a PPS thread per session. Tested with live PPS and works.
Diffstat (limited to 'ntpshm.c')
-rw-r--r--ntpshm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ntpshm.c b/ntpshm.c
index 24bda477..b3316ba4 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -694,8 +694,6 @@ void gpsd_await_pps_initialization(struct gps_context_t *context)
}
#endif /* defined(HAVE_SYS_TIMEPPS_H) */
-volatile bool gpsd_ppsmonitor_stop = false;
-
/*@-mustfreefresh -type@ -unrecog*/
static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
{
@@ -754,7 +752,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
* is that no GPS lights up more than one of these pins. By waiting on
* all of them we remove a configuration switch.
*/
- while (!gpsd_ppsmonitor_stop) {
+ while (session->thread_report_hook != NULL) {
bool ok = false;
#if defined(HAVE_SYS_TIMEPPS_H)
bool ok_kpps = false;
@@ -1103,10 +1101,10 @@ static void pps_thread_activate(struct gps_device_t *session)
}
}
-static void pps_thread_deactivate(struct gps_device_t *session UNUSED)
+static void pps_thread_deactivate(struct gps_device_t *session)
/* cleanly terminate PPS thread */
{
- gpsd_ppsmonitor_stop = true;
+ session->thread_report_hook = NULL;
}
#endif /* PPS_ENABLE */
@@ -1125,7 +1123,7 @@ void ntpd_link_deactivate(struct gps_device_t *session)
}
void ntpd_link_activate(struct gps_device_t *session)
-/* set up ntpshm storage for a session - may fail if not called as root */
+/* set up ntpshm storage for a session */
{
/* If we are talking to ntpd, allocate a shared-memory segment for "NMEA" time data */
if (session->context->enable_ntpshm)