From ec8290acdaea21b16d98f1ef5d4ae8a28ab2109a Mon Sep 17 00:00:00 2001 From: rpj Date: Wed, 3 Nov 2004 01:08:41 +0000 Subject: Mutex, semaphore, thread ID, test suite changes - see ChangeLogs --- pthread_setschedparam.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pthread_setschedparam.c') diff --git a/pthread_setschedparam.c b/pthread_setschedparam.c index d23e5d0..d3af098 100644 --- a/pthread_setschedparam.c +++ b/pthread_setschedparam.c @@ -72,6 +72,7 @@ ptw32_setthreadpriority (pthread_t thread, int policy, int priority) { int prio; int result; + ptw32_thread_t * tp = (ptw32_thread_t *) thread.p; prio = priority; @@ -99,12 +100,12 @@ ptw32_setthreadpriority (pthread_t thread, int policy, int priority) #endif - result = pthread_mutex_lock (&thread->threadLock); + result = pthread_mutex_lock (&tp->threadLock); if (0 == result) { /* If this fails, the current priority is unchanged. */ - if (0 == SetThreadPriority (thread->threadH, prio)) + if (0 == SetThreadPriority (tp->threadH, prio)) { result = EINVAL; } @@ -114,10 +115,10 @@ ptw32_setthreadpriority (pthread_t thread, int policy, int priority) * Must record the thread's sched_priority as given, * not as finally adjusted. */ - thread->sched_priority = priority; + tp->sched_priority = priority; } - (void) pthread_mutex_unlock (&thread->threadLock); + (void) pthread_mutex_unlock (&tp->threadLock); } return result; -- cgit v1.2.3