1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

AndroidGCS: Add back a few synchronize blocks in telemetry to avoid removing

elements twice.
This commit is contained in:
James Cotton 2012-08-12 17:21:40 -05:00
parent 335ccc54a3
commit 785cda8052

View File

@ -551,11 +551,13 @@ public class Telemetry {
// Get object information from queue (first the priority and then the regular queue)
ObjectQueueInfo objInfo;
synchronized (objPriorityQueue) {
if ( !objPriorityQueue.isEmpty() )
{
objInfo = objPriorityQueue.remove();
}
else if ( !objQueue.isEmpty() )
} else {
synchronized (objQueue) {
if ( !objQueue.isEmpty() )
{
objInfo = objQueue.remove();
}
@ -563,6 +565,9 @@ public class Telemetry {
{
return;
}
}
}
}
// Check if a connection has been established, only process GCSTelemetryStats updates
// (used to establish the connection)