On 31/10/2017 12:26, Pavel Dovgalyuk wrote:
> 
> +
>      if (timeout) {
>          spin_counter = 0;
> -        qemu_mutex_unlock_iothread();

This was done on purpose because it improved performance.  It's probably
pointless now that TCG runs outside the iothread, but it should be a
separate patch.

>      } else {
>          spin_counter++;
>      }
> +    qemu_mutex_unlock_iothread();
> +
> +    if (replay_mode != REPLAY_MODE_NONE) {
> +        replay_mutex_unlock();
> +    }

This is quite ugly.  Perhaps you can push the "if" down inside the
functions?

Paolo

>      ret = qemu_poll_ns((GPollFD *)gpollfds->data, gpollfds->len, timeout);
>  
> -    if (timeout) {
> -        qemu_mutex_lock_iothread();
> +    if (replay_mode != REPLAY_MODE_NONE) {
> +        replay_mutex_lock();
>      }
>  
> +    qemu_mutex_lock_iothread();
> +


Reply via email to