From b6a7ffc76df31b7b7a7c2f5371957af0abf55aba Mon Sep 17 00:00:00 2001 From: ahodgkinson Date: Tue, 20 Jun 2006 15:09:28 +0000 Subject: [PATCH] Needed to lock/unlock the random generator mutex when getting a random number via f_getRandomUINT32. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@586 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- ftk/src/ftkmisc.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ftk/src/ftkmisc.cpp b/ftk/src/ftkmisc.cpp index e732e50..6df89f1 100644 --- a/ftk/src/ftkmisc.cpp +++ b/ftk/src/ftkmisc.cpp @@ -1813,7 +1813,13 @@ FLMUINT32 FLMAPI f_getRandomUINT32( FLMUINT32 ui32Low, FLMUINT32 ui32High) { - return( gv_pRandomGenerator->getUINT32( ui32Low, ui32High)); + FLMUINT32 ui32Value; + + f_mutexLock( gv_hRandomGenMutex); + ui32Value = gv_pRandomGenerator->getUINT32( ui32Low, ui32High); + f_mutexUnlock( gv_hRandomGenMutex); + + return( ui32Value); } /****************************************************************************