Commit d85d80c
refactor(FileLogger2): proper thread sync without TSAN suppressions
Changes:
- Replace spin-wait with condition_variable for thread startup sync
- Remove early callback dropping - queue is always safe to access
- Remove TSAN suppressions - proper sync approach doesn't need them
- Delete move ops in base class for consistency with derived class
- Simplify base constructor - no mutex hack needed
The key insight: the queue is protected by queue_mutex and initialized
before StatusChangeLogger subscribes to callbacks (base-from-member
idiom), so callbacks can safely enqueue at any time.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 195136d commit d85d80c
3 files changed
Lines changed: 14 additions & 30 deletions
File tree
- include/behaviortree_cpp/loggers
- src/loggers
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 41 | + | |
| 42 | + | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
98 | | - | |
99 | | - | |
| 96 | + | |
100 | 97 | | |
101 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
102 | 101 | | |
103 | 102 | | |
104 | 103 | | |
| |||
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 115 | + | |
| 116 | + | |
123 | 117 | | |
124 | 118 | | |
125 | 119 | | |
| |||
142 | 136 | | |
143 | 137 | | |
144 | 138 | | |
145 | | - | |
146 | | - | |
147 | | - | |
| 139 | + | |
| 140 | + | |
148 | 141 | | |
149 | 142 | | |
150 | | - | |
| 143 | + | |
151 | 144 | | |
| 145 | + | |
152 | 146 | | |
153 | 147 | | |
154 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
0 commit comments