[Qemu-devel] Re: [PATCH] simpletrace: Thread-safe tracing

2011-02-28 Thread Stefan Hajnoczi
On Sun, Feb 27, 2011 at 6:16 PM, Paolo Bonzini wrote: > On 02/27/2011 06:02 PM, Stefan Hajnoczi wrote: >> >> On Sun, Feb 27, 2011 at 3:13 PM, Paolo Bonzini >>  wrote: >>> >>> On 02/27/2011 03:58 PM, Stefan Hajnoczi wrote: + * Trace records are written out by a dedicated thread.  The thre

[Qemu-devel] Re: [PATCH] simpletrace: Thread-safe tracing

2011-02-27 Thread Paolo Bonzini
On 02/27/2011 06:02 PM, Stefan Hajnoczi wrote: On Sun, Feb 27, 2011 at 3:13 PM, Paolo Bonzini wrote: On 02/27/2011 03:58 PM, Stefan Hajnoczi wrote: + * Trace records are written out by a dedicated thread. The thread waits for + * records to become available, writes them out, and then waits a

Re: [Qemu-devel] Re: [PATCH] simpletrace: Thread-safe tracing

2011-02-27 Thread Stefan Hajnoczi
On Sun, Feb 27, 2011 at 3:13 PM, Paolo Bonzini wrote: > On 02/27/2011 03:58 PM, Stefan Hajnoczi wrote: >> >> + * Trace records are written out by a dedicated thread.  The thread waits >> for >> + * records to become available, writes them out, and then waits again. >> + */ >> +static pthread_mutex

[Qemu-devel] Re: [PATCH] simpletrace: Thread-safe tracing

2011-02-27 Thread Paolo Bonzini
On 02/27/2011 03:58 PM, Stefan Hajnoczi wrote: + * Trace records are written out by a dedicated thread. The thread waits for + * records to become available, writes them out, and then waits again. + */ +static pthread_mutex_t trace_lock = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t trace_a