mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 04:35:53 +00:00
[SCHEDSVC] Improvements to the scheduler service
Use WaitForMultipleObjects in the mail scheduler loop: - Use events to signal service stop and job update events to the main loop. - Use the timeout timer to start the next job.
This commit is contained in:
parent
03294dd097
commit
e4d79e514a
4 changed files with 108 additions and 32 deletions
|
@ -112,8 +112,6 @@ NetrJobAdd(
|
|||
pJob->JobId = dwNextJobId++;
|
||||
dwJobCount++;
|
||||
|
||||
// Cancel the start timer
|
||||
|
||||
/* Append the new job to the job list */
|
||||
InsertTailList(&JobListHead, &pJob->JobEntry);
|
||||
|
||||
|
@ -129,11 +127,13 @@ NetrJobAdd(
|
|||
DumpStartList(&StartListHead);
|
||||
#endif
|
||||
|
||||
// Update the start timer
|
||||
|
||||
/* Release the job list lock */
|
||||
RtlReleaseResource(&JobListLock);
|
||||
|
||||
/* Set the update event */
|
||||
if (Events[1] != NULL)
|
||||
SetEvent(Events[1]);
|
||||
|
||||
/* Return the new job ID */
|
||||
*pJobId = pJob->JobId;
|
||||
|
||||
|
@ -162,8 +162,6 @@ NetrJobDel(
|
|||
/* Acquire the job list lock exclusively */
|
||||
RtlAcquireResourceExclusive(&JobListLock, TRUE);
|
||||
|
||||
// Cancel the start timer
|
||||
|
||||
JobEntry = JobListHead.Flink;
|
||||
while (JobEntry != &JobListHead)
|
||||
{
|
||||
|
@ -193,11 +191,13 @@ NetrJobDel(
|
|||
JobEntry = JobEntry->Flink;
|
||||
}
|
||||
|
||||
// Update the start timer
|
||||
|
||||
/* Release the job list lock */
|
||||
RtlReleaseResource(&JobListLock);
|
||||
|
||||
/* Set the update event */
|
||||
if (Events[1] != NULL)
|
||||
SetEvent(Events[1]);
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue