[babl] Make babl_ticks() thread safe.



commit 97950348d062ea9afdc8701df56798bf41fb856a
Author: �yvind Kolås <pippin gimp org>
Date:   Sat Nov 21 15:50:41 2009 +0000

    Make babl_ticks() thread safe.
    
    Made a static variable a temporary variable in the only function using
    it.

 babl/babl-util.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/babl/babl-util.c b/babl/babl-util.c
index 6abcd43..40ddfa2 100644
--- a/babl/babl-util.c
+++ b/babl/babl-util.c
@@ -24,7 +24,6 @@
 #include <time.h>
 
 static struct timeval start_time;
-static struct timeval measure_time;
 
 #define usecs(time)    ((time.tv_sec - start_time.tv_sec) * 1000000 + time.tv_usec)
 
@@ -42,6 +41,7 @@ init_ticks (void)
 long
 babl_ticks (void)
 {
+  struct timeval measure_time;
   init_ticks ();
   gettimeofday (&measure_time, NULL);
   return usecs (measure_time) - usecs (start_time);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]