Re: Exiting non-POSIX threads?
Re: Exiting non-POSIX threads?
- Subject: Re: Exiting non-POSIX threads?
- From: Steve Sisak <email@hidden>
- Date: Mon, 29 Jul 2013 05:27:02 -0400
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 (email@hidden)
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:
This email sent to email@hidden