mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-27 16:54:15 +01:00
AndroidGCS HID: Remove more locks to try and prevent HID deadlocking
This commit is contained in:
parent
f96b419a85
commit
d5c1e3578e
@ -343,7 +343,7 @@ public class Telemetry {
|
||||
/**
|
||||
* Update an object based on its metadata properties
|
||||
*/
|
||||
private synchronized void updateObject(UAVObject obj)
|
||||
private void updateObject(UAVObject obj)
|
||||
{
|
||||
// Get metadata
|
||||
UAVObject.Metadata metadata = obj.getMetadata();
|
||||
@ -393,7 +393,7 @@ public class Telemetry {
|
||||
* Called when a transaction is successfully completed (uavtalk event)
|
||||
* @throws IOException
|
||||
*/
|
||||
private synchronized void transactionCompleted(UAVObject obj, boolean result) throws IOException
|
||||
private void transactionCompleted(UAVObject obj, boolean result) throws IOException
|
||||
{
|
||||
if (DEBUG) Log.d(TAG,"UAVTalk transactionCompleted");
|
||||
// Check if there is a pending transaction and the objects match
|
||||
@ -401,8 +401,11 @@ public class Telemetry {
|
||||
{
|
||||
if (DEBUG) Log.d(TAG,"Telemetry: transaction completed for " + obj.getName());
|
||||
// Complete transaction
|
||||
|
||||
synchronized(transTimer) {
|
||||
transTimer.cancel();
|
||||
transPending = false;
|
||||
}
|
||||
|
||||
//Send signal
|
||||
obj.transactionCompleted(result);
|
||||
@ -419,9 +422,10 @@ public class Telemetry {
|
||||
* Called when a transaction is not completed within the timeout period (timer event)
|
||||
* @throws IOException
|
||||
*/
|
||||
private synchronized void transactionTimeout() throws IOException
|
||||
private void transactionTimeout() throws IOException
|
||||
{
|
||||
if (DEBUG) Log.d(TAG,"Telemetry: transaction timeout.");
|
||||
synchronized(transTimer) {
|
||||
transTimer.cancel();
|
||||
// Proceed only if there is a pending transaction
|
||||
if ( transPending )
|
||||
@ -446,12 +450,13 @@ public class Telemetry {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Start an object transaction with UAVTalk, all information is stored in transInfo
|
||||
* @throws IOException
|
||||
*/
|
||||
private synchronized void processObjectTransaction() throws IOException
|
||||
private void processObjectTransaction() throws IOException
|
||||
{
|
||||
if (transPending)
|
||||
{
|
||||
@ -472,9 +477,11 @@ public class Telemetry {
|
||||
}
|
||||
else
|
||||
{
|
||||
synchronized(transTimer) {
|
||||
transTimer.cancel();
|
||||
transPending = false;
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
if (ERROR) Log.e(TAG,"Error: inside of processObjectTransaction with no transPending");
|
||||
@ -628,11 +635,12 @@ public class Telemetry {
|
||||
* TODO: Clean-up
|
||||
* @throws IOException
|
||||
*/
|
||||
private synchronized void processPeriodicUpdates() throws IOException
|
||||
private void processPeriodicUpdates() throws IOException
|
||||
{
|
||||
|
||||
if (DEBUG) Log.d(TAG, "processPeriodicUpdates()");
|
||||
// Stop timer
|
||||
|
||||
updateTimer.cancel();
|
||||
|
||||
// Iterate through each object and update its timer, if zero then transmit object.
|
||||
@ -705,7 +713,7 @@ public class Telemetry {
|
||||
return stats;
|
||||
}
|
||||
|
||||
public synchronized void resetStats()
|
||||
public void resetStats()
|
||||
{
|
||||
utalk.resetStats();
|
||||
txErrors = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user