• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Exiting non-POSIX threads?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Exiting non-POSIX threads?
      • From: Ken Thomases <email@hidden>
References: 
 >Exiting non-POSIX threads? (From: Oleg Krupnov <email@hidden>)

  • Prev by Date: Exiting non-POSIX threads?
  • Next by Date: Re: Exiting non-POSIX threads?
  • Previous by thread: Exiting non-POSIX threads?
  • Next by thread: Re: Exiting non-POSIX threads?
  • Index(es):
    • Date
    • Thread