• 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: How to handle wake up from sleep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to handle wake up from sleep


  • Subject: Re: How to handle wake up from sleep
  • From: Michael Smith <email@hidden>
  • Date: Tue, 17 Feb 2009 19:51:51 -0800


On Feb 16, 2009, at 6:59 PM, searockcliff wrote:

Now I have another question about the IOCommandGate.
http://developer.apple.com/documentation/devicedrivers/conceptual/IOKitFundamentals/PowerMgmt/chapter_10_section_7.html#//apple_ref/doc/uid/TP0000020-SW6
Should I put all the IO request to runAction()?

This depends on your device and queueing model.  The ::runAction() method is the normal way of ensuring mutual exclusion for your driver.

When should I call commandSleep() and commandWakeup()?

Use commandSleep() like you would use msleep() in a BSD system; it atomically drops the workloop lock and puts the calling thread to sleep.

Use commandWakeup() to wake up threads that you might have put to sleep with commandSleep().

 When system goes to sleep, should I call commandSleep()?
When system goes to wakeup, should I call comandWakeup()?
But the system cannot be waken up if I use above methods.

Put the text editor down and back slowly away from the kernel.

It's clear from the above questions that you have not yet understood how device drivers are typically structured, and the way that that structure is expressed in I/O Kit.  Please take some time to familiarise yourself with the way that drivers like yours are normally organised, and how they get their work done.  Right now, you're just confusing yourself...

 = Mike

 _______________________________________________
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

References: 
 >Re: How to handle wake up from sleep (From: Ethan Bold <email@hidden>)
 >How to handle wake up from sleep (From: searockcliff <email@hidden>)
 >Re:Re: How to handle wake up from sleep (From: searockcliff <email@hidden>)

  • Prev by Date: Re: Mach Bootstrap_create_server, "server_command" parameter
  • Next by Date: Re: Mach Bootstrap_create_server, "server_command" parameter
  • Previous by thread: Re:Re: Re: How to handle wake up from sleep
  • Next by thread: Mach Bootstrap_create_server, "server_command" parameter
  • Index(es):
    • Date
    • Thread