Make random-state initialization threadsafe
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 9 Oct 2012 00:03:35 +0000 (20:03 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 2 Jan 2013 07:04:03 +0000 (01:04 -0600)
src/fccache.c

index 14dcf32..751cea1 100644 (file)
@@ -323,6 +323,11 @@ retry:
       FcMutexFinish (lock);
       goto retry;
     }
+
+    FcMutexLock (lock);
+    /* Initialize random state */
+    FcRandom ();
+    return;
   }
   FcMutexLock (lock);
 }