OS X 进程控制
我正在为 leopard 编写一个进程控制器内核扩展。 该应用程序使我能够使用 SIGSUS 暂停进程并使计算机进入睡眠状态。 我的问题是,当使用视频/音频的应用程序(例如 iTunes 或 GarageBand)被挂起,然后我尝试让计算机进入睡眠状态时,睡眠过程会等待音频/视频应用程序结束,超时时间为 30 秒。 实际上,当我尝试在音频/视频应用程序暂停时让计算机进入睡眠状态时,计算机会挂起 30 秒(可能是暂停的应用程序没有响应睡眠请求),然后正常睡眠。 当我唤醒计算机并向视频/音频应用程序发送 SIGCON 时,它会正常继续。
有没有办法改变 30 秒的等待时间? 或者让它根本不等待? 或者还有其他解决方案吗?
I'm writing a process-controller kernel extension for leopard. The application enables me to suspend process's with SIGSUS and to make the computer sleep. My problem is when an application that uses video / audio (e.g iTunes or GarageBand) is suspended and then I try to make the computer sleep, the sleep process waits on the audio / video application to end with a timeout of 30 seconds. In reality, when I try to put the computer to sleep when an audio / video application is suspended, the computer hangs for 30 seconds (probably the suspended application is not responding to the sleep request) and then it sleeps normally. When I wake the computer and send SIGCON to the video / audio application, it continues normally.
Is there a way to change that 30 second wait time out? Or to make it not wait at all? Or any other solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要回答您的问题,获取有关您正在尝试执行的操作的更多信息将会很有帮助。 首先,为什么要编写内核扩展? 您在问题中谈到的任何内容都没有表明您需要这样做。 其次,为什么在让系统进入睡眠状态之前要挂起所有进程? 您应该能够优雅地使系统进入睡眠状态,而无需暂停任何进程。
To answer your question it would be helpful to get some more information about what you're trying to do. First, why are you writing a kernel extension? Nothing you've talked about in the problem suggests you need to do this. Second, why are you suspending all of the processes before putting the system to sleep? You should be able to gracefully sleep the system without suspending any processes.