Commit a0635d7
committed
fix(macos): Break the corebluetooth loop when manager turned off
closes #387
In Core Bluetooth when the device is not applicable for background
bluetooth manager will create an event for state change. And then change
the manager state to power off. Currently, it is not tracked at all which
leads to the forever stuck unresolved issues while the connection to
peripheral is still held.
An additional problem I faced that there is no way to manually kill the
event loop of the corebluetooth from outside so the
`CoreBluetoothInternal::drop` is never called because it is always
living in the stalled thread.
In this change, I added an API to access the manager state and exited
the event loop when if the manager turned off.1 parent d59b29b commit a0635d7
3 files changed
+72
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
71 | 83 | | |
72 | 84 | | |
73 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
85 | 105 | | |
86 | 106 | | |
87 | 107 | | |
| |||
130 | 150 | | |
131 | 151 | | |
132 | 152 | | |
| 153 | + | |
133 | 154 | | |
134 | 155 | | |
135 | 156 | | |
136 | | - | |
| 157 | + | |
137 | 158 | | |
138 | 159 | | |
139 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
399 | 400 | | |
400 | 401 | | |
401 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
402 | 406 | | |
403 | 407 | | |
404 | 408 | | |
405 | 409 | | |
406 | | - | |
| 410 | + | |
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
| |||
789 | 793 | | |
790 | 794 | | |
791 | 795 | | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
792 | 808 | | |
793 | 809 | | |
794 | 810 | | |
| |||
831 | 847 | | |
832 | 848 | | |
833 | 849 | | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
834 | 855 | | |
835 | 856 | | |
836 | 857 | | |
| |||
1004 | 1025 | | |
1005 | 1026 | | |
1006 | 1027 | | |
1007 | | - | |
| 1028 | + | |
1008 | 1029 | | |
1009 | 1030 | | |
1010 | 1031 | | |
| |||
1103 | 1124 | | |
1104 | 1125 | | |
1105 | 1126 | | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
1106 | 1130 | | |
1107 | 1131 | | |
1108 | 1132 | | |
| |||
1184 | 1208 | | |
1185 | 1209 | | |
1186 | 1210 | | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
1187 | 1219 | | |
1188 | 1220 | | |
1189 | 1221 | | |
| |||
0 commit comments