summaryrefslogtreecommitdiff
path: root/debian/patches/fix-locking0003-kern-bootstrap-tune-locking.patch
blob: 990a31f199293a945a2742cdb365ec81ad187a7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 0bae7342bf2275a210117bbcc4fa5a13523eaa81 Mon Sep 17 00:00:00 2001
From: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Sat, 25 Jul 2015 02:15:31 +0200
Subject: [PATCH gnumach 3/5] kern/bootstrap: tune locking

* kern/bootstrap.c (boot_script_exec_cmd): Avoid holding the lock
across the call to `thread_create'.
---
 kern/bootstrap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index cb0f976..aad0fb1 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -719,10 +719,10 @@ boot_script_exec_cmd (void *hook, task_t task, char *path, int argc,
       thread_t thread;
       struct user_bootstrap_info info = { mod, argv, 0, };
       simple_lock_init (&info.lock);
-      simple_lock (&info.lock);
 
       err = thread_create ((task_t)task, &thread);
       assert(err == 0);
+      simple_lock (&info.lock);
       thread->saved.other = &info;
       thread_start (thread, user_bootstrap);
       err = thread_resume (thread);
-- 
2.1.4