Commit f04af76
committed
Introduce
Previously, when enqueuing new events to the `EventQueue`, we'd
directly attempt to wake any notifiers/notify any threads waiting on
the `Condvar` about the newly available events. This could of course
mean we'd notify them while ourselves still holding some locks, e.g., on
the peer state.
Here, we instead introduce a `EventQueueNotifierGuard` type that will
notify about pending events if necesssary, which mitigates any potential
lock contention: we now simply have to ensure that any method calling
`enqueue` holds the notifier before retrieving any locks.EventQueueNotifierGuard type1 parent 6c6a0a9 commit f04af76
File tree
5 files changed
+67
-4
lines changed- lightning-liquidity/src
- lsps0
- lsps1
- lsps2
5 files changed
+67
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
101 | 144 | | |
102 | 145 | | |
103 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| 145 | + | |
| 146 | + | |
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
| |||
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
| 224 | + | |
| 225 | + | |
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| |||
259 | 264 | | |
260 | 265 | | |
261 | 266 | | |
| 267 | + | |
| 268 | + | |
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
| |||
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
| 347 | + | |
| 348 | + | |
340 | 349 | | |
341 | 350 | | |
342 | 351 | | |
| |||
378 | 387 | | |
379 | 388 | | |
380 | 389 | | |
| 390 | + | |
| 391 | + | |
381 | 392 | | |
382 | 393 | | |
383 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
| |||
249 | 251 | | |
250 | 252 | | |
251 | 253 | | |
| 254 | + | |
| 255 | + | |
252 | 256 | | |
253 | 257 | | |
254 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
| 807 | + | |
| 808 | + | |
807 | 809 | | |
808 | 810 | | |
809 | 811 | | |
| |||
1092 | 1094 | | |
1093 | 1095 | | |
1094 | 1096 | | |
| 1097 | + | |
1095 | 1098 | | |
1096 | 1099 | | |
1097 | 1100 | | |
| |||
1111 | 1114 | | |
1112 | 1115 | | |
1113 | 1116 | | |
1114 | | - | |
1115 | 1117 | | |
1116 | 1118 | | |
1117 | 1119 | | |
| |||
1128 | 1130 | | |
1129 | 1131 | | |
1130 | 1132 | | |
| 1133 | + | |
1131 | 1134 | | |
1132 | 1135 | | |
1133 | 1136 | | |
| |||
0 commit comments