Commit 7afb46b
committed
Make atomics less bad;
- Remove horrible stdatomic.h/threads.h shim
- Compiler engineers are better at writing atomic/thread stuff than I am
- LÖVR requires C11 threads and atomics now
- Add /experimental:c11atomics for MSVC support
- Requires VS 17.5 preview 2 (ca. 2023)
- Use atomics properly everywhere
- Any variables used as arguments to atomic_* functions must be atomic
- Including refcounts
- Compiler warns about this now, which is good
- Generally, only use atomic functions when needed
- Regular assignment/operators on atomic variables are already atomic
- Add thread safe module initialization helper in util, use it everywhere1 parent 7b4c6b4 commit 7afb46b
File tree
22 files changed
+221
-543
lines changed- src
- api
- core
- lib/std
- modules
- audio
- data
- event
- filesystem
- graphics
- headset
- math
- physics
- system
- thread
- timer
22 files changed
+221
-543
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | 302 | | |
304 | 303 | | |
305 | 304 | | |
| |||
653 | 652 | | |
654 | 653 | | |
655 | 654 | | |
656 | | - | |
| 655 | + | |
657 | 656 | | |
658 | 657 | | |
659 | 658 | | |
| |||
669 | 668 | | |
670 | 669 | | |
671 | 670 | | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | 671 | | |
677 | 672 | | |
678 | 673 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1148 | 1148 | | |
1149 | 1149 | | |
1150 | 1150 | | |
1151 | | - | |
1152 | 1151 | | |
| 1152 | + | |
1153 | 1153 | | |
1154 | 1154 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
This file was deleted.
0 commit comments