Commit 4d1b317
fix(package-manager): add thread synchronization to prevent race conditions
- Add global mutex lock using OnceLock for file system operations
- Protect critical sections in download_package_manager function
- Add test-specific lock for temp directory creation
- Fix "Directory not empty" errors during concurrent test execution
The synchronization ensures concurrent calls won't interfere when:
- Checking if files exist
- Removing old directories
- Renaming temporary directories
- Creating shim files
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 73cab43 commit 4d1b317
1 file changed
Lines changed: 23 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| |||
440 | 448 | | |
441 | 449 | | |
442 | 450 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
447 | 463 | | |
448 | | - | |
449 | | - | |
450 | | - | |
| 464 | + | |
| 465 | + | |
451 | 466 | | |
452 | 467 | | |
453 | 468 | | |
| |||
555 | 570 | | |
556 | 571 | | |
557 | 572 | | |
558 | | - | |
559 | | - | |
560 | 573 | | |
561 | 574 | | |
562 | 575 | | |
| |||
0 commit comments