Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



-----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:
http://lists.apple.com/mailman/options/darwin-kernel/email@hidden

This email sent to email@hidden

References: 
 >current_task() in start() , stop(), thread differs (From: Parav Pandit <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.