Commit e9d0e3f
committed
usbdmx: Move widget deletion to main thread
Currently when a usb device is remove the libusb event thread, though the
hotplug handler, will cause the widget's Device to be deleted in the main
thread and wait for this to complete in the libusb thread.
If any of the destructors triggered by device deletion causes libusb_close
to be called this causes a deadlock as libusb_close will try to take over
handling of events in the main thread while the libusb thread is waiting
for libusb_close, via the destructors, to finish.
Just move both widget and device deletion to the main thread to prevent
this scenario.1 parent a95a6f7 commit e9d0e3f
2 files changed
+16
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
277 | 270 | | |
278 | 271 | | |
279 | 272 | | |
| |||
353 | 346 | | |
354 | 347 | | |
355 | 348 | | |
356 | | - | |
| 349 | + | |
357 | 350 | | |
358 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
359 | 354 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
366 | 362 | | |
| 363 | + | |
367 | 364 | | |
368 | 365 | | |
369 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
114 | | - | |
| 113 | + | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
0 commit comments