lock the data mutex for the minimum necessary instructions
This commit is contained in:
parent
da668011fe
commit
e157090e35
@ -496,7 +496,9 @@ void Universe::tx_loop_()
|
||||
// see if this is new data or re-transmitting
|
||||
auto sleep = std::chrono::milliseconds(minimum_update_time);
|
||||
null_start_mutex.lock();
|
||||
if (null_start_data != last_null_data)
|
||||
bool new_data = (null_start_data != last_null_data);
|
||||
null_start_mutex.unlock();
|
||||
if (new_data)
|
||||
{
|
||||
retransmission_count = 0;
|
||||
last_null_data = null_start_data;
|
||||
@ -504,7 +506,6 @@ void Universe::tx_loop_()
|
||||
else
|
||||
if (++retransmission_count >= 2)
|
||||
sleep = std::chrono::milliseconds(keep_alive_interval);
|
||||
null_start_mutex.unlock();
|
||||
|
||||
// send the sACN message
|
||||
sACNsend();
|
||||
|
Loading…
Reference in New Issue
Block a user