Patchwork make trace_thread_create() use its function arg

login
register
mail settings
Submitter Jun Koi
Date March 8, 2012, 6:20 a.m.
Message ID <CA+g7VZ2oyED32NF+qk0rCX1qjv0AprTodW4_J5KqvdnrkPsGfQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/145458/
State New
Headers show

Comments

Jun Koi - March 8, 2012, 6:20 a.m.
this patch makes trace_thread_create() to use its function arg to
initialize thread.
the other choice is to make this a function to use void arg, but i
prefer this way.

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
Stefan Hajnoczi - March 8, 2012, 11:59 a.m.
On Thu, Mar 08, 2012 at 02:20:37PM +0800, Jun Koi wrote:
> this patch makes trace_thread_create() to use its function arg to
> initialize thread.
> the other choice is to make this a function to use void arg, but i
> prefer this way.
> 
> Signed-off-by: Jun Koi <junkoi2004@gmail.com>
> 

Thanks, applied to the tracing patches tree:
https://github.com/stefanha/qemu/commits/tracing

Stefan

Patch

diff --git a/trace/simple.c b/trace/simple.c
index bbc9930..33ae486 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -363,7 +363,7 @@  static GThread *trace_thread_create(GThreadFunc fn)
     sigfillset(&set);
     pthread_sigmask(SIG_SETMASK, &set, &oldset);
 #endif
-    thread = g_thread_create(writeout_thread, NULL, FALSE, NULL);
+    thread = g_thread_create(fn, NULL, FALSE, NULL);
 #ifndef _WIN32
     pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 #endif