Commit ede3b34
committed
DEV-896 review fixes: trace-list snapshot to prevent lock inversion, harden monotonic trace
- filterDataAndPlot accessed mListofTraces (size/get) while holding the new
chart monitor (chart -> list order), while clearAllDataBuffer and the
trace-resize path hold the mListofTraces monitor while calling
chart-locking trace mutators (list -> chart). Snapshot the trace list
before entering the chart monitor so the cycle cannot form.
- Trace2DLtdMonotonicX: NaN X (jchart2d discontinuation marker) now
contributes nothing to the ascending run instead of being absorbed by the
first-point guard; in-place point mutation (STATE_CHANGED) resets the run
so the class stays a safe drop-in for Trace2DLtd; tracking fields made
volatile so the unlocked conservative resets cannot tear and spuriously
enable the fast path; corrected the setMaxSize-grow Javadoc reasoning.
Correctness test: 11596 checks vs stock Trace2DLtd, 0 mismatches.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JjgNkS6wtPkQUdK3KdHVdN1 parent 5af0117 commit ede3b34
2 files changed
Lines changed: 43 additions & 9 deletions
File tree
- ShimmerDriverPC/src/main/java/com/shimmerresearch/guiUtilities/plot
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2008 | 2008 | | |
2009 | 2009 | | |
2010 | 2010 | | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
2011 | 2017 | | |
2012 | 2018 | | |
2013 | 2019 | | |
| |||
2068 | 2074 | | |
2069 | 2075 | | |
2070 | 2076 | | |
2071 | | - | |
| 2077 | + | |
2072 | 2078 | | |
2073 | 2079 | | |
2074 | | - | |
| 2080 | + | |
2075 | 2081 | | |
2076 | 2082 | | |
2077 | 2083 | | |
| |||
Lines changed: 35 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
63 | | - | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
94 | 101 | | |
95 | 102 | | |
96 | 103 | | |
97 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
98 | 110 | | |
99 | 111 | | |
100 | 112 | | |
| |||
112 | 124 | | |
113 | 125 | | |
114 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
115 | 143 | | |
116 | 144 | | |
117 | 145 | | |
| |||
0 commit comments