Commit b073715
authored
Add thread-safe initialization for Routes with framework-specific locking (#183)
- Introduce _lock field with conditional compilation:
- Use Lock type for .NET 9.0 and greater
- Fallback to object for older framework versions
- Refactor InitializeRoutesFromResource to use local static GetRoutes method
- Wrap _routes initialization in lock to prevent race conditions1 parent 554b953 commit b073715
1 file changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
65 | | - | |
66 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
67 | 81 | | |
68 | | - | |
69 | 82 | | |
70 | 83 | | |
71 | 84 | | |
| |||
0 commit comments