mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
stat-file: Protect flags field with atomic operation
Coverity complaint that this field should be protected by a mutex as other accesses are with the mutex locked. Use atomic operation. Not in an hot path in any case. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Uri Lublin <uril@redhat.com>
This commit is contained in:
parent
fc1005718f
commit
bde8ef5a4e
@ -190,7 +190,7 @@ stat_file_add_counter(RedStatFile *stat_file, StatNodeRef parent, const char *na
|
||||
return NULL;
|
||||
}
|
||||
node = &stat_file->stat->nodes[ref];
|
||||
node->flags |= SPICE_STAT_NODE_FLAG_VALUE;
|
||||
__sync_or_and_fetch(&node->flags, SPICE_STAT_NODE_FLAG_VALUE);
|
||||
return &node->value;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user