(random, srandom) [_WIN32]: Provide random and srandom
POSIX equivalents instead of using the WIN32 rand/srand functions. The files were derived from GNU libc source. (empth_threadMain) [_WIN32]: Remove the srandom() as the POSIX equivalent are not thread specific as the WIN32 functions were.
This commit is contained in:
parent
7241773f60
commit
c115ed1327
5 changed files with 788 additions and 11 deletions
|
@ -326,8 +326,6 @@ loc_Exit_Handler(DWORD fdwCtrlType)
|
|||
static void
|
||||
empth_threadMain(void *pvData)
|
||||
{
|
||||
time_t now;
|
||||
|
||||
empth_t *pThread = pvData;
|
||||
|
||||
/* Out of here... */
|
||||
|
@ -343,13 +341,6 @@ empth_threadMain(void *pvData)
|
|||
/* Signal that the thread has started. */
|
||||
SetEvent(hThreadStartEvent);
|
||||
|
||||
/*
|
||||
* seed the rand() function
|
||||
* In WIN32, each thread has seed
|
||||
*/
|
||||
time(&now);
|
||||
srandom(now ^ (unsigned)pThread);
|
||||
|
||||
/* Switch to this thread context */
|
||||
loc_RunThisThread(NULL);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue