qthreads icon indicating copy to clipboard operation
qthreads copied to clipboard

Yield Outside A Qthread Needs Error

Open insertinterestingnamehere opened this issue 2 years ago • 0 comments

I noticed this while working on https://github.com/sandialabs/qthreads/pull/182. We currently hit undefined behavior if qthread_yield gets called outside a qthread. It'd be nice to have a better error mode for that (and anything else that should only be called within a qthread). Currently the result is an inscrutable sanitizer error about a misaligned access that's fairly difficult to trace back to an out-of-context yield. Even just an assert failure would be much better. I'm not sure how to actually detect this case off the top of my head though, so I'm just documenting this for now.