Re: Deadlock in My KEXT with NKE
On Wednesday, February 11, 2004, at 05:52 PM, Matt Jaffa wrote: SO I was reading in the archives that if my NKE send function is blocked(or in this case sleeping) it releases control of the funnel, this is what could be causeing the Deadlock maybe. And I was also reading that you have to lock it so that the state isn't changed and won't cause this deadlock, it pointed me to sys/lock.h Using this how do I lock that so that it doesn't give up the funnel while it is sleeping. You have to give up the funnel whilst sleeping. It's not just a good idea; it's the law. The idea is that you are sleeping, waiting for state to change. If you have a lock on that state, you won't permit other threads to modify that state. Hence... Thumb's Rule says: if you want to sleep, make sure your house is in order; you can't tell what's going to happen while you are asleep, so assure that nothing bad happens. Who knows? Your thread may never get to run again. Regards, Justin -- Justin C. Walker, Curmudgeon-At-Large * Institute for General Semantics | If you're not confused, | You're not paying attention *--------------------------------------*-------------------------------* -- /~\ The ASCII Justin C. Walker, Curmudgeon-at-Large \ / Ribbon Campaign X Help cure HTML Email / \ _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Justin Walker