The original comment was separated from the code at some point, and didn't
reflect the use of libc's other than glibc for Linux.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376821
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
#undef ONE_MILLION
-/*! \brief glibc puts a lock inside random(3), so that the results are thread-safe.
- * BSD libc (and others) do not. */
-
#ifndef linux
AST_MUTEX_DEFINE_STATIC(randomlock);
#endif
}
}
#endif
+ /* XXX - Thread safety really depends on the libc, not the OS.
+ *
+ * But... popular Linux libc's (uClibc, glibc, eglibc), all have a
+ * somewhat thread safe random(3) (results are random, but not
+ * reproducible). The libc's for other systems (BSD, et al.), not so
+ * much.
+ */
#ifdef linux
res = random();
#else