1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

Cleanup on randomization

tsan reported that rand() is not thread safe, so create
a thread safe wrapper, use rand_r() if available.
Consolidate the function, initialization and cleanup in
dict.c and make sure it is initialized in xmlInitParser()
This commit is contained in:
Daniel Veillard
2012-05-18 15:41:31 +08:00
parent 9d9685ad88
commit 379ebc1d77
5 changed files with 57 additions and 17 deletions

View File

@@ -79,6 +79,13 @@ void __xmlGlobalInitMutexLock(void);
void __xmlGlobalInitMutexUnlock(void);
void __xmlGlobalInitMutexDestroy(void);
#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME)
/*
* internal thread safe random function
*/
int __xmlRandom(void);
#endif
#ifdef IN_LIBXML
#ifdef __GNUC__
#ifdef PIC