Message ID | 20140828183157.GH3011@type.youpi.perso.aquilenet.fr |
---|---|
State | New |
Headers | show |
> This is what I had put, is some information still missing? Oh, was that in the message? I must have missed it because I didn't see a ChangeLog header. > * sysdeps/mach/hurd/fork.c (__fork): Lock SS->lock around __proc_dostop() call. Don't use () as if it were part of a function name. Otherwise that is just right (though it's ok to omit " (__fork)" in a libc file whose file name matches the function). > + /* Keep our SS locked while stopping other threads, so they don't get a > + chance to be having it locked in the copied space. */ I didn't bother to say that this sentence is rather awkward to a native English speaker: s/to be having it locked/to have it locked/. The formatting is now correct, so you can go ahead and commit. Thanks, Roland
Roland McGrath, le Thu 28 Aug 2014 13:04:14 -0700, a écrit : > > This is what I had put, is some information still missing? > > Oh, was that in the message? I must have missed it because I didn't see a > ChangeLog header. Ah, probably, indeed. > (though it's ok to omit " (__fork)" in a libc file whose file name > matches the function). Ok. Thanks, Samuel
diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c index ab11bab..1f0b8a3 100644 --- a/sysdeps/mach/hurd/fork.c +++ b/sysdeps/mach/hurd/fork.c @@ -122,9 +122,13 @@ __fork (void) ports_locked = 1; + /* Keep our SS locked while stopping other threads, so they don't get a + chance to be having it locked in the copied space. */ + __spin_lock (&ss->lock); /* Stop all other threads while copying the address space, so nothing changes. */ err = __proc_dostop (_hurd_ports[INIT_PORT_PROC].port, ss->thread); + __spin_unlock (&ss->lock); if (!err) { stopped = 1;