The use of active_devices might not be thread safe if this library is used in more than one thread. Putting a new key in active_devices could cause it to be reallocated in one thread while another thread is reading which might cause undefined behaviour.
The use of
active_devicesmight not be thread safe if this library is used in more than one thread. Putting a new key inactive_devicescould cause it to be reallocated in one thread while another thread is reading which might cause undefined behaviour.