Commit e5929ab9 authored by Andrey Vagin's avatar Andrey Vagin Committed by Cyrill Gorcunov

restore: sync threads

Use the save mechanosm as for processes.

* Threads should starts together with processes
* If a thread segfaulted, we should be able to detect it.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 27b20dfc
......@@ -422,7 +422,7 @@ static int prepare_shared(int ps_fd)
task_add_pid(e.pid);
task_entries->nr++;
task_entries->nr += e.nr_threads;
lseek(ps_fd, e.nr_children * sizeof(u32) + e.nr_threads * sizeof(u32), SEEK_CUR);
}
......
......@@ -196,6 +196,13 @@ long restore_thread(struct thread_restore_args *args)
*/
restore_creds(NULL);
cr_wait_dec(&task_entries->nr_in_progress);
write_num(sys_gettid());
write_string_n(": Restored");
cr_wait_while(&task_entries->start, CR_STATE_RESTORE);
cr_wait_dec(&task_entries->nr_in_progress);
new_sp = (long)rt_sigframe + 8;
asm volatile(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment