What is it waiting for? Maybe an event is more appropriate?
Casper
_____
From: ros-diffs-bounces@reactos.org [mailto:ros-diffs-bounces@reactos.org] On Behalf Of hbirr@svn.reactos.com Sent: 13. november 2005 18:32 To: ros-diffs@reactos.com Subject: [ros-diffs] [hbirr] 19209: Shutdown the process manager beforeshutdown the registry.
Shutdown the process manager before shutdown the registry. Running processes may have opened a registry handle. Modified: trunk/reactos/ntoskrnl/ex/power.c _____
Modified: trunk/reactos/ntoskrnl/ex/power.c
--- trunk/reactos/ntoskrnl/ex/power.c 2005-11-13 17:28:24 UTC (rev 19208) +++ trunk/reactos/ntoskrnl/ex/power.c 2005-11-13 17:32:01 UTC (rev 19209) @@ -148,15 +148,16 @@ sizeof(PCH))]); }
+ PiShutdownProcessManager(); + Waittime.QuadPart = (LONGLONG)-10000000; /* 1sec */ + KeDelayExecutionThread(KernelMode, FALSE, &Waittime); + CmShutdownRegistry(); IoShutdownRegisteredFileSystems(); IoShutdownRegisteredDevices();
- PiShutdownProcessManager(); MiShutdownMemoryManager();
- Waittime.QuadPart = (LONGLONG)-10000000; /* 1sec */ - KeDelayExecutionThread(KernelMode, FALSE, &Waittime);
if (Action == ShutdownNoReboot) {
Casper Hornstrup wrote:
What is it waiting for? Maybe an event is more appropriate?
Casper
PiShutdownProcessManager tries to shutdown all running processes except the system process, but it didn't wait for the termination of each process. KeDelayExecutionThread is a workaround for this.
- Hartmut
Hartmut Birr wrote:
PiShutdownProcessManager tries to shutdown all running processes except the system process, but it didn't wait for the termination of each process. KeDelayExecutionThread is a workaround for this.
I wouldn't say that's a workaround, it's a hack. What if at this point still not all processes are terminated (e.g. on a very slow system)?
- Thomas