I'm writing an exception handler where I want to terminate a crashed
thread without terminating the entire process. Before GCD I used the
following code:


if ([NSThread currentThread] != [NSThread mainThread])
{
   [NSThread exit];
}

However for GCD thread (created with dispatch_async()) I get the
following signal:

pthread_exit() may only be called against threads created via pthread_create()


Is there a way to handle this case?

Is there a way to exit a GCD thread?

At least, is there a way of telling POSIX threads from GCD / other threads?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to