I saw this function being used in a UISearchBarDelegate method textDidChange. I looked all over for any documentation and couldn't come up with anything. Just wondering if anyone could shed any light on what this function is doing.
objc_sync_exit(self)
When you write synchronized code to stop something being run more than once at a time (Objective-C: "@synchronized"), that gets transformed into calls to objc_sync_enter() and objc_sync_exit() calls behind the scenes.
If you saw someone using these functions directly, it would suggest that they couldn't use the plain old synchronized block (or their own Swift wrapper for it) because their code is split up somehow - synchronization starts and ends in different places.
Here's a nice Swift implementation that wraps this code similarly to Objective-C.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With