diff options
author | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2019-10-07 15:36:37 +0100 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2019-10-11 14:19:49 +0100 |
commit | 5626f8c6d46832b02ce4fdc0bd109516bc812043 (patch) | |
tree | 1f5ebde7290eb695f62e050a047168cc5c745feb /tests | |
parent | 8f8d528e73144c063deafc534df0a04c67f6f98e (diff) | |
download | qemu-5626f8c6d46832b02ce4fdc0bd109516bc812043.zip qemu-5626f8c6d46832b02ce4fdc0bd109516bc812043.tar.gz qemu-5626f8c6d46832b02ce4fdc0bd109516bc812043.tar.bz2 |
rcu: Add automatically released rcu_read_lock variants
RCU_READ_LOCK_GUARD() takes the rcu_read_lock and then uses glib's
g_auto infrastructure (and thus whatever the compiler's hooks are) to
release it on all exits of the block.
WITH_RCU_READ_LOCK_GUARD() is similar but is used as a wrapper for the
lock, i.e.:
WITH_RCU_READ_LOCK_GUARD() {
stuff under lock
}
Note the 'unused' attribute is needed to work around clang bug:
https://bugs.llvm.org/show_bug.cgi?id=43482
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20191007143642.301445-2-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions