summaryrefslogtreecommitdiff
path: root/libgps.c
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2008-09-10 05:40:44 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2008-09-10 05:40:44 +0000
commit5d5c12da291fda82c41c69814d7f89c8f481e2f5 (patch)
tree1de8967a5bd2915cad071f1bd5e2b985bedf9f0a /libgps.c
parentd708929df18bcc7d8248f1295db3d47a3271e591 (diff)
downloadgpsd-5d5c12da291fda82c41c69814d7f89c8f481e2f5.tar.gz
Clean up a canceled thread. From Bartos-Elekes Zsolt on gpsd-dev
Diffstat (limited to 'libgps.c')
-rw-r--r--libgps.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libgps.c b/libgps.c
index 8cf64742..0c4eddc2 100644
--- a/libgps.c
+++ b/libgps.c
@@ -603,6 +603,7 @@ int gps_del_callback(struct gps_data_t *gpsdata, pthread_t *handler)
{
int res;
/*@i@*/res = pthread_cancel(*handler); /* we cancel the whole thread */
+ pthread_join(*handler, NULL); /* wait for thread to actually terminate */
gpsdata->thread_hook = NULL; /* finally we cancel the callback */
if (res == 0) /* tell gpsd to stop sending data */
(void)gps_query(gpsdata,"w-\n"); /* disable watcher mode */