On Mon, Sep 19, 2016 at 14:50:47 +0200, Paolo Bonzini wrote:
> From: Sergey Fedorov <[email protected]>
>
> Convert pthread_mutex_t and pthread_cond_t to QemuMutex and QemuCond.
> This will allow to make some locks and conditional variables common
> between user and system mode emulation.
>
> Signed-off-by: Sergey Fedorov <[email protected]>
> Signed-off-by: Sergey Fedorov <[email protected]>
> Reviewed-by: Alex Bennée <[email protected]>
> Signed-off-by: Alex Bennée <[email protected]>
> Message-Id: <[email protected]>
> Signed-off-by: Paolo Bonzini <[email protected]>
> ---
> linux-user/main.c | 53 +++++++++++++++++++++++++++++++----------------------
> 1 file changed, 31 insertions(+), 22 deletions(-)
>
> diff --git a/linux-user/main.c b/linux-user/main.c
> index 3ad70f8..0add1b0 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -111,17 +111,25 @@ int cpu_get_pic_interrupt(CPUX86State *env)
> We don't require a full sync, only that no cpus are executing guest code.
> The alternative is to map target atomic ops onto host equivalents,
> which requires quite a lot of per host/target work. */
> -static pthread_mutex_t cpu_list_mutex = PTHREAD_MUTEX_INITIALIZER;
> -static pthread_mutex_t exclusive_lock = PTHREAD_MUTEX_INITIALIZER;
Just a pet peeve of mine: this is a great opportunity to
rename cpu_list_mutex to cpu_list_lock.
E.