views:

264

answers:

2

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?

A: 

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.

Joey Hagedorn
A: 

that's pretty much what I'm trying to do. It's not an application with a purpose, I'm just trying to do this for training purposes. I'm writing a kernel extension because I want to learn how to do that as well, no other important reason. I'm not suspending the processes before I put the system into sleep, but my application enables the user to do so. So I have to solve this issue in order to enable to user to make the system sleep even if a process (specifically a process that uses audio / video) is suspended at sleep time. I don't want this 30 sec timeout before the system sleeps and I don't want to continue the process that causes the timeout only so it will respond to the sleep request. Is there a way to cancel this 30 sec timeout?

Thanks again.