[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] mem-prealloc: initialize cond and mutex

From: Paolo Bonzini
Subject: Re: [PATCH] mem-prealloc: initialize cond and mutex
Date: Mon, 9 Mar 2020 11:05:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 09/03/20 11:03, Igor Mammedov wrote:
>> +    qemu_cond_init(&page_cond);
>> +    qemu_mutex_init(&page_mutex);
> Is it possible for touch_all_pages to be called several times?
> If it's then it probably needs a guard against that to make
> sure it won't explode, something like:
> static bool page_mutex_inited;
> if(page_mutex_inited)
>   page_mutex_inited = true
>   qemu_mutex_init(&page_mutex) 
>   ...

Hmm, good idea, it should also use GOnce.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]