From eca19329e11c472df9b62da0a643de6f90bb7f46 Mon Sep 17 00:00:00 2001 From: rpj Date: Tue, 28 Jul 1998 09:29:22 +0000 Subject: Tue Jul 28 14:04:29 1998 Ross Johnson * implement.h: Add _PTHREAD_VALID macro. * sync.c (pthread_join): Modify to use the new thread type and _pthread_delete_thread(). Rename "target" to "thread". Remove extra local variable "target". (pthread_detach): Ditto. * signal.c (pthread_sigmask): Move init of "us" out of inner block. Fix instance of "this" should have been "us". Rename "us" to "thread". * sched.c (pthread_setschedparam): Modify to use the new thread type. (pthread_getschedparam): Ditto. * private.c (_pthread_find_thread): Fix return type and arg. * implement.h: Remove _PTHREAD_YES and _PTHREAD_NO. (_pthread_new_thread): Add prototype. (_pthread_find_thread): Ditto. (_pthread_delete_thread): Ditto. (_pthread_new_thread_entry): Remove prototype. (_pthread_find_thread_entry): Ditto. (_pthread_delete_thread_entry): Ditto. ( _PTHREAD_NEW, _PTHREAD_INUSE, _PTHREAD_EXITED, _PTHREAD_REUSE): Add. * create.c (pthread_create): Minor rename "us" to "new" (I need these cues but it doesn't stop me coming out with some major bugs at times). Load start_routine and arg into the thread so the wrapper can call it. * exit.c (pthread_exit): Fix pthread_this should be pthread_self. * cancel.c (pthread_setcancelstate): Change _pthread_threads_thread_t * to pthread_t and init with pthread_this(). (pthread_setcanceltype): Ditto. --- sched.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sched.c') diff --git a/sched.c b/sched.c index 21780c6..e29e684 100644 --- a/sched.c +++ b/sched.c @@ -36,7 +36,7 @@ int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param *param) { /* Validate the thread id. */ - if (_pthread_find_thread_entry(thread) < 0) + if (_PTHREAD_VALID(thread) < 0) { return EINVAL; } @@ -61,7 +61,7 @@ int pthread_setschedparam(pthread_t thread, int policy, } /* This is practically guaranteed to return TRUE. */ - (void) SetThreadPriority(thread, param->sched_policy); + (void) SetThreadPriority(thread->win32handle, param->sched_policy); return 0; } @@ -71,7 +71,7 @@ int pthread_getschedparam(pthread_t thread, int *policy, int prio; /* Validate the thread id. */ - if (_pthread_find_thread_entry(thread) < 0) + if (_PTHREAD_VALID(thread) != 0) { return EINVAL; } @@ -86,7 +86,7 @@ int pthread_getschedparam(pthread_t thread, int *policy, *policy = SCHED_OTHER; /* Fill out the sched_param structure. */ - prio = GetThreadPriority(thread); + prio = GetThreadPriority(thread->win32handle); if (prio == THREAD_PRIORITY_ERROR_RETURN) { return EINVAL; -- cgit v1.2.3