summaryrefslogtreecommitdiff
path: root/ppsthread.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-02-11 17:48:37 -0800
committerGary E. Miller <gem@rellim.com>2015-02-11 17:51:10 -0800
commit46fe0500cd4d984b7fbeb426428cf99a4a3833b6 (patch)
tree6f53c45eae618a24ab2d80dc99ccbdf2c5aae265 /ppsthread.c
parentf66737728283a82b5244c1caf581083171103a8d (diff)
downloadgpsd-46fe0500cd4d984b7fbeb426428cf99a4a3833b6.tar.gz
Move a gps_report() out of a time critical area.
gps_reqport calls a mutex and that can add large and variable delays. We are going for 1 nSec here, but likely just getting 100 nSec in the wild.
Diffstat (limited to 'ppsthread.c')
-rw-r--r--ppsthread.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ppsthread.c b/ppsthread.c
index ee05d3a1..c6a7e99d 100644
--- a/ppsthread.c
+++ b/ppsthread.c
@@ -328,11 +328,9 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
session->gpsdata.dev.path, errno, strerror(errno));
break;
}
- /* start of time critical section */
- gpsd_report(&session->context->errout, LOG_PROG,
- "PPS ioctl(TIOCMIWAIT) on %s succeeded\n",
- session->gpsdata.dev.path);
- /* quick, grab a copy of last_fixtime before it changes */
+ /* start of time critical section
+ * only error reporting, not success reporting in critical section
+ * quick, grab a copy of last_fixtime before it changes */
last_fixtime_real = session->last_fixtime.real;
last_fixtime_clock = session->last_fixtime.clock;
@@ -369,6 +367,9 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
}
/*@ -ignoresigns */
/* end of time critical section */
+ gpsd_report(&session->context->errout, LOG_PROG,
+ "PPS ioctl(TIOCMIWAIT) on %s succeeded\n",
+ session->gpsdata.dev.path);
/*
* If there was no valid time from the GPS when the PPS event was