PUD: move a dump outside of a critical section
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 6 Mar 2012 11:44:01 +0000 (12:44 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 6 Mar 2012 13:17:15 +0000 (14:17 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/receiver.c

index c56a9f8..3f8fd2a 100644 (file)
@@ -870,13 +870,12 @@ bool receiverUpdateGpsInformation(unsigned char * rxBuffer, size_t rxCount) {
                memcpy(&transmitGpsInformation.txPosition.nmeaInfo, &posAvgEntry->nmeaInfo, sizeof(nmeaINFO));
                memcpy(&transmitGpsInformation.txGateway, bestGateway, olsr_cnf->ipsize);
                transmitGpsInformation.updated = true;
+               (void) pthread_mutex_unlock(&transmitGpsInformation.mutex);
 
 #if defined(PUD_DUMP_AVERAGING)
-               dump_nmeaInfo(&transmitGpsInformation.txPosition.nmeaInfo,
+               dump_nmeaInfo(&posAvgEntry->nmeaInfo,
                        "receiverUpdateGpsInformation: transmitGpsInformation");
 #endif /* PUD_DUMP_AVERAGING */
-
-               (void) pthread_mutex_unlock(&transmitGpsInformation.mutex);
        }
 
        if (externalStateChange) {