Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
NSStringDrawing.DrawAtPoint checks for UI thread but shouldn't #5235
Like #5234, NSGraphics functionality works on background threads.
Steps to Reproduce
Text is drawn.
Thread consistency exception is thrown.
Thread safety documentation tends to be limited and something incorrect. We'll check them against Apple's Main Thread Checker and disable the thread check if no assertion occurs. It might not be 100% accurate but, at least, it will be consistent with the results from Xcode.
Thanks! I appreciate the fix because the normal workaround of
NSApplication.CheckForIllegalCrossThreadCalls = false; // Code NSApplication.CheckForIllegalCrossThreadCalls = true;
doesn't work well in a multi-threaded app because it introduces tons of race conditions. Which means I have to turn the feature off completely. :-(