server: Implement waiting for job objects.

This commit is contained in:
Sebastian Lackner 2015-04-03 17:20:35 +11:00 committed by Alexandre Julliard
parent 7984fb9fbe
commit a7247df6ca
2 changed files with 6 additions and 3 deletions

View File

@ -2469,7 +2469,6 @@ static void test_WaitForJobObject(void)
ok(ret, "TerminateJobObject error %u\n", GetLastError());
dwret = WaitForSingleObject(job, 500);
todo_wine
ok(dwret == WAIT_OBJECT_0 || broken(dwret == WAIT_TIMEOUT),
"WaitForSingleObject returned %u\n", dwret);
@ -2478,7 +2477,6 @@ static void test_WaitForJobObject(void)
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
CloseHandle(job);
todo_wine
win_skip("TerminateJobObject doesn't signal job, skipping tests\n");
return;
}

View File

@ -149,6 +149,7 @@ struct job
int num_processes; /* count of running processes */
unsigned int limit_flags; /* limit flags */
int terminating; /* job is terminating */
int signaled; /* job is signaled */
struct completion *completion_port; /* associated completion port */
apc_param_t completion_key; /* key to send with completion messages */
};
@ -191,6 +192,7 @@ static struct job *create_job_object( struct directory *root, const struct unico
job->num_processes = 0;
job->limit_flags = 0;
job->terminating = 0;
job->signaled = 0;
job->completion_port = NULL;
job->completion_key = 0;
}
@ -281,6 +283,8 @@ static void terminate_job( struct job *job, int exit_code )
}
job->terminating = 0;
job->signaled = 1;
wake_up( &job->obj, 0 );
}
static void job_destroy( struct object *obj )
@ -303,7 +307,8 @@ static void job_dump( struct object *obj, int verbose )
static int job_signaled( struct object *obj, struct wait_queue_entry *entry )
{
return 0;
struct job *job = (struct job *)obj;
return job->signaled;
}
struct ptid_entry