Commit 6765091
antoshkka
feat util: fix ThreadSanitizer reported data race
```
WARNING: ThreadSanitizer: data race (pid=123179)
Read of size 8 at 0x0000065aad98 by thread T14:
#0 NSystemInfo::CachedNumberOfCpus() util/system/info.cpp:241:10 (taxi-uservices-userver-core-tests+0x4155bba)
#1 engine::(anonymous namespace)::TaskProcessorThreadStartedHook() userver/core/src/engine/task/task_processor.cpp:100:15 (taxi-uservices-userver-core-tests+0x5306bc8)
#2 engine::TaskProcessor::PrepareWorkerThread(unsigned long) userver/core/src/engine/task/task_processor.cpp:347:5 (taxi-uservices-userver-core-tests+0x5306bc8)
```
The change on a hot path is equivalent to the previously compiler generated x86 code (just a `load` instruction). On other platforms this could actually fix a data race.
commit_hash:acb1fe1b8f3075cc27b18aab4f1bd0b88292c2701 parent 689931d commit 6765091
1 file changed
+13
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
237 | | - | |
238 | | - | |
| 238 | + | |
| 239 | + | |
239 | 240 | | |
240 | 241 | | |
241 | | - | |
242 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
243 | 246 | | |
244 | 247 | | |
245 | | - | |
| 248 | + | |
246 | 249 | | |
247 | 250 | | |
248 | 251 | | |
249 | | - | |
250 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
251 | 256 | | |
252 | 257 | | |
253 | | - | |
| 258 | + | |
254 | 259 | | |
255 | 260 | | |
256 | 261 | | |
| |||
0 commit comments