blob: 13dda8878010ebb5bf3511a68500d6e7639257f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
$NetBSD: patch-af,v 1.1.1.1 2006/06/03 23:29:24 rh Exp $
--- threadutil/src/ThreadPool.c.orig 2006-02-28 07:48:27.000000000 +1000
+++ threadutil/src/ThreadPool.c
@@ -339,9 +339,11 @@ tp->stats.totalJobsLQ++; tp->stats.total
*****************************************************************************/
static void SetSeed( ) {
struct timeb t;
+ volatile union { volatile pthread_t tid; volatile unsigned i; } idu;
ftime( &t );
- srand( ( unsigned int )t.millitm + ithread_get_current_thread_id( ) );
+ idu.tid = ithread_get_current_thread_id();
+ srand( ( unsigned int )t.millitm + idu.i );
}
/****************************************************************************
|