suspend

Bash date/time arithmetic

◇◆丶佛笑我妖孽 提交于 2020-01-12 18:50:33
问题 I have a little Bash script which suspends the computer after a given number of minutes. However, I'd like to extend it to tell me what the time will be when it will be suspended, so I can get a rough idea of how long time I have left so to speak. #!/bin/sh let SECS=$1*60 echo "Sleeping for" $1 "minutes, which is" $SECS "seconds." sleep $SECS && pm-suspend The only argument to the script will be how many minutes from now the computer should be suspended. All I want to add to this script is

How to create suspended process from c# without P/Invoke?

六月ゝ 毕业季﹏ 提交于 2020-01-11 10:10:15
问题 WinAPI CreateProcess has the flag CREATE_SUSPENDED so it's possible to attach process to JobObject before it has done something and then to call ResumeThread for its main thread. The only that I found searching for a solution is this post written 11 years ago! 回答1: The only way to do this is with CreateProcess . The .net Process class does not offer the functionality. Either p/invoke CreateProcess or use a mixed mode C++/CLI assembly to call the same. 来源: https://stackoverflow.com/questions

How to create suspended process from c# without P/Invoke?

[亡魂溺海] 提交于 2020-01-11 10:08:14
问题 WinAPI CreateProcess has the flag CREATE_SUSPENDED so it's possible to attach process to JobObject before it has done something and then to call ResumeThread for its main thread. The only that I found searching for a solution is this post written 11 years ago! 回答1: The only way to do this is with CreateProcess . The .net Process class does not offer the functionality. Either p/invoke CreateProcess or use a mixed mode C++/CLI assembly to call the same. 来源: https://stackoverflow.com/questions

How does transaction suspension work in MySQL?

时光总嘲笑我的痴心妄想 提交于 2020-01-01 05:18:10
问题 In the Spring Framework manual they state that for a PROPAGATION_REQUIRES_NEW the current transaction will be suspended. What does that "suspended transaction"? The timer for the timeout stops counting on the current transaction? What are the actual implication of such suspension? Thank you, Asaf 回答1: It doesn't mean anything special, a suspended transaction is just a transaction that is temporarily not used for inserts, updates, commit or rollback, because a new transaction should be created

How can I run code on Windows Mobile while being suspended?

女生的网名这么多〃 提交于 2019-12-29 07:18:08
问题 I'd like to run some C++ code while the Windows Mobile PocketPC is (or seems) being suspended. An example what I mean is the HTC Home plugin that shows (among others) a tab where the HTC Audio Manager can be used to play back mp3 files. When I press the on/off button, the display goes black, but the audio keeps playing. The only button to switch back on is the on/off button, as expected. What I tried so far is to capture hardware button presses (works) and switch off the video display (works)

Suspend a child process spawned by java

天大地大妈咪最大 提交于 2019-12-24 15:27:46
问题 I have a java program which uses Runtime.exec() to spawn a child process, but I need to be able to programatically suspend it and then start it running again from where it left off. The Java Process object doesn't seem to provide any way to do that. Does anyone know how I might accomplish this? Thank you 回答1: Under UNIX you can Runtime.exec + kill -STOP and -CONT to suspend and resume a process, without using JNI. 回答2: Java is not a low level language. Thus, some interactions with the

How can I detect suspend on Windows Mobile?

走远了吗. 提交于 2019-12-24 11:52:29
问题 We are seeing some occasional data loss with our application on Windows Mobile, and we suspect that some buffered data is not being flushed to disk when the device is suspending. We would like to manually flush data to the disk when the device is about to suspend. On Windows, we do this by catching the WM_POWERBROADCAST message, but this message is not available on Windows Mobile. I found a two-year-old quote on a message board that said: You need to realize that you are *not* guaranteed that

How can I detect suspend on Windows Mobile?

笑着哭i 提交于 2019-12-24 11:48:09
问题 We are seeing some occasional data loss with our application on Windows Mobile, and we suspect that some buffered data is not being flushed to disk when the device is suspending. We would like to manually flush data to the disk when the device is about to suspend. On Windows, we do this by catching the WM_POWERBROADCAST message, but this message is not available on Windows Mobile. I found a two-year-old quote on a message board that said: You need to realize that you are *not* guaranteed that

Sleep(suspend) and Resuming windows form starts program on worker thread instead of main thread

孤者浪人 提交于 2019-12-22 12:53:41
问题 The windows form I am working on subscribes to Microsoft.Win32.SystemEvents.PowerModeChanged and on Suspend it runs the Close() method on the form. On Resume it runs the Run() function like it would on initial load. The problem is that when the computer is woken from sleep mode the PowerModeChanged event is triggered on a worker thread named ".Net SystemEvents" and when Run() is called it recreates the form on this worker thread instead of the main thread. This form is a project I inherited

Windows: Atomically suspend an entire process?

余生颓废 提交于 2019-12-22 09:46:46
问题 Using Win32 API it is only possible to suspend a single thread using SuspendThread() but not a complete process in one call. Iterating over a process threads and suspending them one at a time is not a good option since it may cause dead-locks and unexpected behavior. This is supposed to be something that is possible in kernel using a function from the DDK (which I don't remember its name). How is it possible to expose this function to user mode? Is there any other way to achieve this without