aboutsummaryrefslogtreecommitdiff
path: root/blockjob.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-03-05 16:53:48 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2015-03-10 10:49:25 +0100
commit21b7cf9e07e5991c57b461181cfb5bbb6fe7a9d6 (patch)
treea23bc5afcac5819a20533f48f178d3e949c27006 /blockjob.c
parent24fa90499f8b24bcba2960a3316d797f9b80b5e9 (diff)
downloadqemu-21b7cf9e07e5991c57b461181cfb5bbb6fe7a9d6.zip
qemu-21b7cf9e07e5991c57b461181cfb5bbb6fe7a9d6.tar.gz
qemu-21b7cf9e07e5991c57b461181cfb5bbb6fe7a9d6.tar.bz2
rcu: handle forks safely
After forking, only the calling thread is duplicated in the child process. The call_rcu thread has to be recreated in the child. Exploit the fact that only one thread exists (same as when constructors run), and just redo the entire initialization to ensure the threads are in the proper state. The only additional things to do are emptying the list of threads registered with RCU, and unlocking the lock that was taken in the prepare callback (implementations are allowed to fail pthread_mutex_init() if the mutex is still locked). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'blockjob.c')
0 files changed, 0 insertions, 0 deletions