fork(): Defer signals and lock the heaps while _kern_fork().

* Also defer signals while registering fork hooks.
* While malloc provides fork heap hooks which lock the heaps and unlock/reinit,
  malloc_debug provides empty hooks.
* Ideas suggested by Ingo, patch reviewed by him. Thanks a lot!
* Also call fork parent hooks on failure.
* Solve locks-up when combining multithreading and process forking, should help
  with #13111.
This commit is contained in:
Jérôme Duval
2016-12-17 21:11:15 +01:00
parent 194afffd85
commit 17b2a3cfcb
8 changed files with 101 additions and 20 deletions
@@ -36,6 +36,9 @@ void __init_env(const struct user_space_program_args *args);
void __init_env_post_heap(void);
status_t __init_heap(void);
void __heap_terminate_after(void);
void __heap_before_fork(void);
void __heap_after_fork_child(void);
void __heap_after_fork_parent(void);
void __init_time(addr_t commPageTable);
void __arch_init_time(struct real_time_data *data, bool setDefaults);