Commit 26fba39
committed
Merge bitcoin#32466: threading: drop CSemaphore in favor of c++20 std::counting_semaphore
6f7052a threading: semaphore: move CountingSemaphoreGrant to its own header (Cory Fields)
fd15469 threading: semaphore: remove temporary convenience types (Cory Fields)
1f89e2a scripted-diff: threading: semaphore: use direct types rather than the temporary convenience ones (Cory Fields)
f21365c threading: replace CountingSemaphore with std::counting_semaphore (Cory Fields)
1acacfb threading: make CountingSemaphore/CountingSemaphoreGrant template types (Cory Fields)
e6ce5f9 scripted-diff: rename CSemaphore and CSemaphoreGrant (Cory Fields)
793166d wallet: change the write semaphore to a BinarySemaphore (Cory Fields)
6790ad2 scripted-diff: rename CSemaphoreGrant and CSemaphore for net (Cory Fields)
d870bc9 threading: add temporary semaphore aliases (Cory Fields)
7b816c4 threading: rename CSemaphore methods to match std::semaphore (Cory Fields)
Pull request description:
This is relatively simple, but done in a bunch of commits to enable scripted diffs.
I wanted to add a semaphore in a branch I've been working on, but it was unclear if I should use `std::counting_semaphore` or stick with our old `CSemaphore`. I couldn't decide, so I just decided to remove all doubt and get rid of ours :)
This replaces our old `CSemaphore` with `std::counting_semaphore` everywhere we used it. `CSemaphoreGrant` is still there as an RAII wrapper, but is now called `CountingSemaphoreGrant` and `BinarySemaphoreGrant` to match. Those have been moved out of `sync.h` to their own file.
ACKs for top commit:
purpleKarrot:
ACK 6f7052a
achow101:
ACK 6f7052a
TheCharlatan:
ACK 6f7052a
hebasto:
ACK 6f7052a, I have reviewed the code and it looks OK.
Tree-SHA512: 5975d13aa21739174e3a22c544620ae3f36345f172b51612346d3b7baf0a07c39ef6fd54f647c87878c21a67951b347a5d4a5f90e897f3f6c0db360a3779d0dfFile tree
6 files changed
+121
-152
lines changed- src
- wallet
6 files changed
+121
-152
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1886 | 1886 | | |
1887 | 1887 | | |
1888 | 1888 | | |
1889 | | - | |
| 1889 | + | |
1890 | 1890 | | |
1891 | 1891 | | |
1892 | 1892 | | |
| |||
2402 | 2402 | | |
2403 | 2403 | | |
2404 | 2404 | | |
2405 | | - | |
| 2405 | + | |
2406 | 2406 | | |
2407 | 2407 | | |
2408 | 2408 | | |
| |||
2576 | 2576 | | |
2577 | 2577 | | |
2578 | 2578 | | |
2579 | | - | |
| 2579 | + | |
2580 | 2580 | | |
2581 | 2581 | | |
2582 | 2582 | | |
| |||
2954 | 2954 | | |
2955 | 2955 | | |
2956 | 2956 | | |
2957 | | - | |
| 2957 | + | |
2958 | 2958 | | |
2959 | 2959 | | |
2960 | 2960 | | |
| |||
2967 | 2967 | | |
2968 | 2968 | | |
2969 | 2969 | | |
2970 | | - | |
| 2970 | + | |
2971 | 2971 | | |
2972 | 2972 | | |
2973 | 2973 | | |
| |||
2978 | 2978 | | |
2979 | 2979 | | |
2980 | 2980 | | |
2981 | | - | |
| 2981 | + | |
2982 | 2982 | | |
2983 | 2983 | | |
2984 | 2984 | | |
| |||
3329 | 3329 | | |
3330 | 3330 | | |
3331 | 3331 | | |
3332 | | - | |
| 3332 | + | |
3333 | 3333 | | |
3334 | 3334 | | |
3335 | 3335 | | |
3336 | | - | |
| 3336 | + | |
3337 | 3337 | | |
3338 | 3338 | | |
3339 | 3339 | | |
| |||
3421 | 3421 | | |
3422 | 3422 | | |
3423 | 3423 | | |
3424 | | - | |
| 3424 | + | |
3425 | 3425 | | |
3426 | 3426 | | |
3427 | 3427 | | |
3428 | 3428 | | |
3429 | 3429 | | |
3430 | | - | |
| 3430 | + | |
3431 | 3431 | | |
3432 | 3432 | | |
3433 | 3433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
729 | 730 | | |
730 | 731 | | |
731 | 732 | | |
732 | | - | |
| 733 | + | |
733 | 734 | | |
734 | 735 | | |
735 | 736 | | |
| |||
1136 | 1137 | | |
1137 | 1138 | | |
1138 | 1139 | | |
1139 | | - | |
| 1140 | + | |
1140 | 1141 | | |
1141 | 1142 | | |
1142 | 1143 | | |
| |||
1491 | 1492 | | |
1492 | 1493 | | |
1493 | 1494 | | |
1494 | | - | |
1495 | | - | |
| 1495 | + | |
| 1496 | + | |
1496 | 1497 | | |
1497 | 1498 | | |
1498 | 1499 | | |
| |||
1614 | 1615 | | |
1615 | 1616 | | |
1616 | 1617 | | |
1617 | | - | |
| 1618 | + | |
1618 | 1619 | | |
1619 | 1620 | | |
1620 | 1621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | 303 | | |
0 commit comments