Re: Problem with semaphore_wait & its correct usage.
Re: Problem with semaphore_wait & its correct usage.
- Subject: Re: Problem with semaphore_wait & its correct usage.
- From: Terry Lambert <email@hidden>
- Date: Mon, 6 Aug 2007 20:32:22 -0700
On Aug 6, 2007, at 8:01 PM, JanakiRam wrote:
I'm writing a kext driver , using semaphore calls. My
application is hanging when the semaphore_wait is executed.
You need to read Chapter 15 of the Kernel Programming Guide:
Semaphores. It's located here:
<http://developer.apple.com/documentation/Darwin/Conceptual/KernelProgramming/synchronization/chapter_15_section_2.html
>
Obvious errors:
- Your start/stop functions incorrectly return success when they
shouldn't.
- The semaphore may not be initialized
- You may permit an unload while the PC for some thread is still in
the KEXT (panic)
- You're sleeping a different semaphore than you wake up
Have you considered using an IOCommandQueue or IOCommandGate instead?
<http://developer.apple.com/documentation/Darwin/Reference/KernelIOKitFramework/IOCommandGate/Classes/IOCommandGate/CompositePage.html
>
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden