On Thu, Apr 18, 2024 at 01:48 PM -0500, Jonathon Jongsma <jjongsma(a)redhat.com>
wrote:
On 4/12/24 8:36 AM, Marc Hartmayer wrote:
> Since @driver->privateData is modified take the lock.
>
[…snip…]
> * signal if that event never comes */
> - scheduleMdevctlUpdate(priv, (event_type ==
G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT));
> + VIR_WITH_OBJECT_LOCK_GUARD(priv) {
> + scheduleMdevctlUpdate(priv, (event_type ==
G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT));
> + }
> }
>
>
I don't see any cases where we would not want to take the lock (e.g.
because it has already been taken), so maybe it would be better simply
to lock the object within the scheduleMdevctlUpdate() function rather
than requiring each caller to lock it?
Hmm, with patch 15 in mind this would make the code more complicated.
Reviewed-by: Jonathon Jongsma <jjongsma(a)redhat.com>
--
Kind regards / Beste Grüße
Marc Hartmayer
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294