PUD: use mutex on stop
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 13 Mar 2012 13:59:33 +0000 (14:59 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 14 Mar 2012 13:28:38 +0000 (14:28 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/receiver.c

index 2145e34..b14b6eb 100644 (file)
@@ -962,9 +962,11 @@ void stopReceiver(void) {
        state.externalState = MOVING;
        state.internalState = MOVING;
 
+       (void) pthread_mutex_lock(&transmitGpsInformation.mutex);
        transmitGpsInformation.updated = false;
        nmea_zero_INFO(&transmitGpsInformation.txPosition.nmeaInfo);
        transmitGpsInformation.txGateway = olsr_cnf->main_addr;
+       (void) pthread_mutex_unlock(&transmitGpsInformation.mutex);
 
        nmea_parser_destroy(&nmeaParser);