Terminates the current thread.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
This method uses the
current class method to access the current thread. Before exiting the thread, this method posts the
NSThread with the thread being exited to the default notification center. Because notifications are delivered synchronously, all observers of
NSThread are guaranteed to receive the notification before the thread exits.
Invoking this method should be avoided as it does not give your thread a chance to clean up any resources it allocated during its execution.