Since we can't lock in signal handlers, the next-best approach is to use thread-local storage to track open files.
Luckily, SIGBUS is guaranteed to be handled by the same thread that caused it, so as long as mmapped files are only accessed from the thread that opened them, this works fine.
Details
Details
Diff Detail
Diff Detail
- Repository
- rB Blender
- Branch
- arcpatch-D12741 (branched from master)
- Build Status
Buildable 19312 Build 19312: arc lint + arc unit
Event Timeline
Comment Actions
Minor change suggested, otherwise this works well & LGTM.
| source/blender/blenlib/intern/BLI_mmap.c | ||
|---|---|---|
| 85–89 | While I don't have a strong opinion on this, a BLI_mmap_init_once() function would avoid the lock & configured check, I have a slight preference for this over locking for a one-off call. | |