Are the macOS accessibility functions thread-safe, or safe to be called in threads other than the application's main thread? (i.e. the functions defined in AXUIElement.h)
I've been working with them for years, and I still haven't been able to figure out in what contexts it's safe to call these functions. In the past I've had issues with calling them from threads other than an application's main thread, but oftentimes these functions are slow and it's not possible to use them in the main thread without causing the application's GUI to block, hence me needing to use them in a separate thread.
As near as I've been able to find, the documentation and header file give no indication of what context it's safe to call these functions in or their thread safety.
I contacted an Apple engineer to get an answer directly, and the answer is that Accessibility functions must be called in the application's main thread.