|
ATM CBCentralManager's delegate does its work on the main queue. With
CoreFoundation event dispatcher it's now possible to use QtBluetooth from
non-gui thread (more generally - from a thread other than main).
This makes main queue useless - and we have to move to a dedicated dispatch
queue. Also, we have to make sure we do not have race conditioins/dead-locks.
This patch:
1. decouples OSXBTLECentralManager and QLowEnergyController so that these
two objects working (potentially) on different threads do not share any data
and do not have to use locks, removes the explicit 'delegate' interface/inheritance
and replaces them with LECentralNotifier class - to be able to use Qt's signal/slot mechanics
for inter-thread communication.
2. all OSXBTLECentralManager's are now executed on qt_LE_queue queue
to avoid any race-conditions (since they potentially update manager's
internal state).
3. Results/errors are now reported using LECentralNotifier's object
(QLowEnergyController has corresponding slots connected to the notifier)
Task-number: QTBUG-49476
Change-Id: Ie07cdc13ad559c96a7d2ff010843fb7bcce07c99
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
|