diff options
author | Gary E. Miller <gem@rellim.com> | 2015-02-11 17:48:37 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-02-11 17:51:10 -0800 |
commit | 46fe0500cd4d984b7fbeb426428cf99a4a3833b6 (patch) | |
tree | 6f53c45eae618a24ab2d80dc99ccbdf2c5aae265 /ppsthread.c | |
parent | f66737728283a82b5244c1caf581083171103a8d (diff) | |
download | gpsd-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.c | 11 |
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 |