At 11:34 AM +0300 7/29/13, Oleg Krupnov wrote:
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?

Just return from the block you passed to dispatch_async()

Is there a way to exit a GCD thread?

There's no such thing as a "GCD thread" only queues.

(OK, there's a pool of threads that GCD uses to service queues, but you don't own them)

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

WAYRTTD?

Exiting threads is bad form in general -- if you're really writing an exception handler, catch it at the outermost level and just return so the thread terminates normally.

Same for your outer block in GCD.

HTH,

-Steve
_______________________________________________

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