Il 25/02/2014 17:17, Stefan Hajnoczi ha scritto:
For the default mutex type (PTHREAD_MUTEX_TIMED_NP) glibc looks safe to
me. The other mutex types are trickier and I haven't audited them.
It also depends on the low-level lock implementation. I looked at the C
one and it's not safe, the x86-o
On Mon, Feb 24, 2014 at 05:48:13PM +0100, Paolo Bonzini wrote:
> Il 24/02/2014 16:53, Stefan Hajnoczi ha scritto:
> >+qemu_cond_destroy(&init_info.init_done_cond);
> >+qemu_mutex_destroy(&init_info.init_done_lock);
> >>>
> >>> Destroying the mutex here is racy. You need to keep i
Il 25/02/2014 16:42, Stefan Hajnoczi ha scritto:
I guess you're saying that while unlocking the mutex is atomic, that
doesn't guarantee pthread won't access the mutex internal state some
more after it has unlocked it. Therefore it's not safe for another
thread to destroy the mutex even after it
On Mon, Feb 24, 2014 at 05:48:13PM +0100, Paolo Bonzini wrote:
> Il 24/02/2014 16:53, Stefan Hajnoczi ha scritto:
> >+qemu_cond_destroy(&init_info.init_done_cond);
> >+qemu_mutex_destroy(&init_info.init_done_lock);
> >>>
> >>> Destroying the mutex here is racy. You need to keep i
Il 24/02/2014 16:53, Stefan Hajnoczi ha scritto:
> >+qemu_cond_destroy(&init_info.init_done_cond);
> >+qemu_mutex_destroy(&init_info.init_done_lock);
>
> Destroying the mutex here is racy. You need to keep it until the
> iothread is destroyed.
I don't think so:
qemu_cond_signal() is c
On Fri, Feb 21, 2014 at 04:18:30PM +0100, Paolo Bonzini wrote:
> Il 21/02/2014 15:51, Stefan Hajnoczi ha scritto:
> >Keep the thread ID around so we can report it via QMP.
> >
> >There's only one problem: qemu_get_thread_id() (gettid() wrapper on
> >Linux) must be called from the thread itself. Th
Il 21/02/2014 15:51, Stefan Hajnoczi ha scritto:
Keep the thread ID around so we can report it via QMP.
There's only one problem: qemu_get_thread_id() (gettid() wrapper on
Linux) must be called from the thread itself. There is no way to get
the thread ID outside the thread.
This patch uses a c
Keep the thread ID around so we can report it via QMP.
There's only one problem: qemu_get_thread_id() (gettid() wrapper on
Linux) must be called from the thread itself. There is no way to get
the thread ID outside the thread.
This patch uses a condvar to wait for iothread_run() to populate the
t