Commit 87674e7
committed
Use a mutex to avoid race conditions corrupting browsers.json
The specific race here is only hit when no browers.json exists.
In that case, JBL attempts to detect & write the browser config
twice, in parallel. If that happens, and the config doesn't
have exactly the same length in both cases, the write ends up
with spurious data appended, and the config file no longer
parses. We can recover from that, but it breaks in the meantime.
With this change, it should (in theory) never happen.1 parent 8d58432 commit 87674e7
3 files changed
+21
-5
lines changedSome 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 | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | | - | |
32 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
| |||
0 commit comments