OS X 进程控制

发布于 2024-07-25 21:51:43 字数 341 浏览 3 评论 0原文

我正在为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

且行且努力 2024-08-01 21:51:43

要回答您的问题,获取有关您正在尝试执行的操作的更多信息将会很有帮助。 首先,为什么要编写内核扩展? 您在问题中谈到的任何内容都没有表明您需要这样做。 其次,为什么在让系统进入睡眠状态之前要挂起所有进程? 您应该能够优雅地使系统进入睡眠状态,而无需暂停任何进程。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文