Add missing lock

This commit is contained in:
Lorenz Meier 2014-07-31 10:49:28 +02:00
parent edccc826a1
commit fbbfe61d74
1 changed files with 5 additions and 0 deletions

View File

@ -808,6 +808,8 @@ Mavlink::resend_message(mavlink_message_t *msg)
return;
}
pthread_mutex_lock(&_send_mutex);
int buf_free = get_free_tx_buf();
_last_write_try_time = hrt_absolute_time();
@ -819,6 +821,7 @@ Mavlink::resend_message(mavlink_message_t *msg)
/* no enough space in buffer to send */
count_txerr();
count_txerrbytes(packet_len);
pthread_mutex_unlock(&_send_mutex);
return;
}
@ -842,6 +845,8 @@ Mavlink::resend_message(mavlink_message_t *msg)
_last_write_success_time = _last_write_try_time;
count_txbytes(packet_len);
}
pthread_mutex_unlock(&_send_mutex);
}
void