[mythtv] [mythtv-commits] mythtv/master commit: c7b18dbc4 by Daniel Kristjansson (daniel-kristjansson)

Daniel Kristjansson danielk at cuymedia.net
Tue Aug 23 21:21:12 UTC 2011


On Tue, 2011-08-23 at 23:07 +0200, Jonathan Martens wrote:
> On 23-8-2011 22:57, Jonathan Martens wrote:
> > I am afraid that this is the first in a line of things braking windows
> > compilation as before I did a 'make distclean' I already observed this

Sorry, I wrote this based on the Microsoft documentation, I didn't
realize mingw doesn't support those the Microsoft stdlib.h. My
googling on mingw and random doesn't seem to turn anything up.
rand() isn't supposed to be used in multi-threaded programs. How
badly it fails depends on a particular implementation, but I can't
find any documentation the MINGW rand() implementation.

If we need to, we can go back to the posix_rand_r() in my previous
commit but it isn't exactly fast since it uses a mutex. Maybe some
windows developer can speak up on how to get decent pseudo-random
numbers in a thread-safe way using mingw?

As for srandom() we can just put a stub in compat.h for that on
windows, it just initializes the pseudo-random number generator.

-- Daniel




More information about the mythtv-dev mailing list