trace: Use pipe_static_mutex.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 6 Mar 2011 09:11:13 +0000 (09:11 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 6 Mar 2011 09:11:13 +0000 (09:11 +0000)
src/gallium/drivers/trace/tr_dump.c
src/gallium/drivers/trace/tr_dump.h
src/gallium/drivers/trace/tr_screen.c

index 51a4ea963357812fcb314f6babd9c2f354bc751c..8a4ec20fb840b760e2029a241fac446b2683fc50 100644 (file)
 
 static struct os_stream *stream = NULL;
 static unsigned refcount = 0;
-static pipe_mutex call_mutex;
+pipe_static_mutex(call_mutex);
 static long unsigned call_no = 0;
 static boolean dumping = FALSE;
-static boolean initialized = FALSE;
 
 
 static INLINE void
@@ -225,26 +224,13 @@ trace_dump_trace_close(void)
       stream = NULL;
       refcount = 0;
       call_no = 0;
-      pipe_mutex_destroy(call_mutex);
    }
 }
 
-void trace_dump_init()
-{
-   if (initialized)
-      return;
-
-   pipe_mutex_init(call_mutex);
-   dumping = FALSE;
-   initialized = TRUE;
-}
-
 boolean trace_dump_trace_begin()
 {
    const char *filename;
 
-   assert(initialized);
-
    filename = debug_get_option("GALLIUM_TRACE", NULL);
    if(!filename)
       return FALSE;
index 74c5e83e9e1686da1a681886ae5525a0218755ce..62b4fe429b1e10b32b309424ab606c9d9ff9a90d 100644 (file)
@@ -42,11 +42,6 @@ struct pipe_surface;
 struct pipe_transfer;
 struct pipe_box;
 
-/*
- * Call before use.
- */
-void trace_dump_init(void);
-
 /*
  * Low level dumping controls.
  *
index c2de2daa883bba8d35e40f5f59dbf9bc5c782d3e..7cfaab060f1c515c1ce9d1a41624139c94cf5c8a 100644 (file)
@@ -472,8 +472,6 @@ trace_enabled(void)
       return trace;
    firstrun = FALSE;
 
-   trace_dump_init();
-
    if(trace_dump_trace_begin()) {
       trace_dumping_start();
       trace = TRUE;