Merge authors:
  Dimitri John Ledkov (xnox)
Related merge proposals:
  https://code.launchpad.net/~xnox/upstart/async-asserts/+merge/222026
  proposed by: Dimitri John Ledkov (xnox)
  review: Approve - James Hunt (jamesodhunt)
------------------------------------------------------------
revno: 1625 [merge]
committer: James Hunt <[email protected]>
branch nick: upstart
timestamp: Wed 2014-06-04 13:50:42 +0100
message:
  * Merge of lp:~xnox/upstart/async-asserts.
modified:
  init/job.c
  init/job_process.c


--
lp:upstart
https://code.launchpad.net/~upstart-devel/upstart/trunk

Your team Upstart Reviewers is subscribed to branch lp:upstart.
To unsubscribe from this branch go to 
https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'init/job.c'
--- init/job.c	2014-06-04 10:38:06 +0000
+++ init/job.c	2014-06-04 11:28:17 +0000
@@ -380,11 +380,18 @@
 {
 	nih_assert (job != NULL);
 
+	/* We may not be blocked by any events when doing first
+	 * transition */
+	nih_assert (job->blocker == NULL);
+
 	while (job->state != state) {
 		JobState old_state;
 		int      unused;
 
-		nih_assert (job->blocker == NULL);
+		/* If we got blocked during async spawns, stop
+		 * transitions */
+		if (job->blocker)
+		    return;
 
 		nih_info (_("%s state changed from %s to %s"), job_name (job),
 			  job_state_name (job->state), job_state_name (state));

=== modified file 'init/job_process.c'
--- init/job_process.c	2014-05-21 22:03:40 +0000
+++ init/job_process.c	2014-06-04 11:28:17 +0000
@@ -2476,8 +2476,9 @@
 
 	if (job && job->state == JOB_SPAWNED) {
 		if (job->class->expect == EXPECT_NONE) {
-			nih_assert (process == PROCESS_MAIN);
-			job_change_state (job, job_next_state (job));
+			if (process == PROCESS_MAIN) {
+				job_change_state (job, job_next_state (job));
+			}
 		}
 	}
        

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to