• 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: current_task() in start() , stop(), thread differs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: current_task() in start() , stop(), thread differs


  • Subject: Re: current_task() in start() , stop(), thread differs
  • From: Brian Bergstrand <email@hidden>
  • Date: Fri, 28 Jan 2005 13:34:38 -0600

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Jan 28, 2005, at 11:44 AM, Parav Pandit wrote:

> Hi,
> Please grant me to ask this silly question.
>
> I am creating one thread using IOCreateThread().
> I want to do syncronization between this thread and my
> interrupt handler, which is in the workloop thread.
>
> Currently I create one semaphore using
> semaphore_create(current_task()) in the start().

Sounds like you have two kernel only threads. If this is the case, you
will get undefined behavior from using current_task(), since you are
tying the semaphore to a (possibly) transient task. When the task
disappears (or gets a signal) the semaphore will make it's way back out
to userland and disappear with it. If you are dealing with strictly
kernel threads, use the kernel global kernel_task to create the sem.
tied to the kernel.

HTH.

Brian Bergstrand <http://www.bergstrand.org/brian/>, AIM: triryche206
PGP Key: <http://www.bergstrand.org/brian/misc/public_key.txt>
MCSE - Must Consult Someone Experienced
As of 01:29:00 PM, iTunes is playing "Guilt On Skin" from "The Dying
Daylights" by "Charon"

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.1

iQA/AwUBQfqFzHnR2Fu2x7aiEQKoJgCfSJrVKnVmjU20JhLm9XvbxbnZAv8AoP2X
nKwJijjcOy99p3m1nhO5MHbN
=jy+U
-----END PGP SIGNATURE-----

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: current_task() in start() , stop(), thread differs
      • From: Parav Pandit <email@hidden>
References: 
 >current_task() in start() , stop(), thread differs (From: Parav Pandit <email@hidden>)

  • Prev by Date: current_task() in start() , stop(), thread differs
  • Next by Date: Re: current_task() in start() , stop(), thread differs
  • Previous by thread: current_task() in start() , stop(), thread differs
  • Next by thread: Re: current_task() in start() , stop(), thread differs
  • Index(es):
    • Date
    • Thread