Commit 0461e33
committed
MTP: fix event loop lock contention
- Upgrade to mtp-rs 0.7.0 (`MtpDevice` is now `Clone`, `next_event()` concurrency documented)
- Clone `MtpDevice` at event loop startup and poll events on the clone without holding Cmdr's device mutex. `next_event()` reads the USB interrupt endpoint, which is independent from bulk endpoints used by file operations.
- Previously the event loop held the device lock for up to 5s per poll cycle (98% duty cycle), starving copy/move/scan operations. Now file operations get uncontested lock access.1 parent 4e1efab commit 0461e33
3 files changed
Lines changed: 25 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
44 | | - | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
74 | 63 | | |
75 | 64 | | |
76 | 65 | | |
| |||
0 commit comments