Document the thread safety requirement of SPUUpdater#2746
Document the thread safety requirement of SPUUpdater#2746sebmarchand wants to merge 1 commit intosparkle-project:2.xfrom
Conversation
| - (void)checkForUpdatesInBackground | ||
| { | ||
| if (![NSThread isMainThread]) { | ||
| SULog(SULogLevelError, @"Error: -checkForUpdatesInBackground can only be called on the main thread"); |
There was a problem hiding this comment.
I suggest using full method style like -[SPUUpdater checkForUpdatesInBackground]
Same for other methods.
I'm also thinking we could just dispatch_async(dispatch_get_main_queue(), ^{ [self checkForUpdatesInBackground] }) anyway to be nice for these three methods.
There was a problem hiding this comment.
Sounds good! We're in a crunch at work so I'm a little bit busy, but I'll do this soon once I have some spare cycles!
|
I incorporated these changes and added some more checks in #2754. Thanks! |
|
Thanks! I'm sorry it took so long to address your comments! We're in a big crunch at work! Really appreciate your help here and your help on the ticket I opened originally! |
|
No worries, had some of my own touches, and haven't been addressing things too promptly either. |
This adds some documentation and some runtime checks to the APIs of SPUUpdater to ensure that they only gets used from the main thread as they're not thread safe.
Fixes # 2745
Misc Checklist
Testing
I tested and verified my change by using one or multiple of these methods:
I ensured that the code was not crashing because of the new checks.
macOS version tested: 15.5