47 lines
1.5 KiB
Text
47 lines
1.5 KiB
Text
$NetBSD: patch-aa,v 1.3 2006/06/26 08:49:48 obache Exp $
|
|
|
|
--- threadutil/src/ThreadPool.c.orig 2006-05-22 16:22:46.000000000 +0900
|
|
+++ threadutil/src/ThreadPool.c
|
|
@@ -92,11 +92,15 @@ FreeThreadPoolJob( ThreadPool * tp,
|
|
static int
|
|
SetPolicyType( PolicyType in )
|
|
{
|
|
+#if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING >= 200112L)
|
|
struct sched_param current;
|
|
|
|
sched_getparam( 0, ¤t );
|
|
current.sched_priority = DEFAULT_SCHED_PARAM;
|
|
return sched_setscheduler( 0, in, ¤t );
|
|
+#else
|
|
+ return 0;
|
|
+#endif
|
|
}
|
|
|
|
/****************************************************************************
|
|
@@ -117,6 +121,7 @@ static int
|
|
SetPriority( ThreadPriority priority )
|
|
{
|
|
|
|
+#if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING >= 200112L)
|
|
int currentPolicy;
|
|
int minPriority = 0;
|
|
int maxPriority = 0;
|
|
@@ -148,6 +153,9 @@ SetPriority( ThreadPriority priority )
|
|
|
|
return pthread_setschedparam( ithread_self( ), currentPolicy,
|
|
&newPriority );
|
|
+#else
|
|
+ return 0;
|
|
+#endif
|
|
|
|
}
|
|
|
|
@@ -341,7 +349,7 @@ tp->stats.totalJobsLQ++; tp->stats.total
|
|
struct timeb t;
|
|
|
|
ftime( &t );
|
|
- srand( ( unsigned int )t.millitm + ithread_get_current_thread_id( ) );
|
|
+ srand( ( unsigned int )t.millitm + ( unsigned int )ithread_get_current_thread_id( ) );
|
|
}
|
|
|
|
/****************************************************************************
|