computenodes / dragino

LoRaWAN implementation in python
GNU Affero General Public License v3.0
27 stars 11 forks source link

Possible race condition waiting for 'transmitting' flag to become False #20

Open BNNorman opened 3 years ago

BNNorman commented 3 years ago

Transmitting should be set False at end of 'on_tx_done()'

If code is waiting for the 'transmitting' flag to become False it could start execution before the on_tx_done() method has finished setting the dio mapping etc.

Basic idea...where D is a dragino instance


while D.transmitting:
    pass

# do something here
# this could be called whilst on_tx_done() is completing it's handling of the interrupt.