From adb117d3fd1dcd3fd306a4d0b09ea1576e7976c7 Mon Sep 17 00:00:00 2001 From: Kurt Miller Date: Fri, 27 Apr 2007 19:40:09 +0000 Subject: fix thread_continuation_t typedef and use passed curthread instead of calling _get_curthread() again. fixes some lint warnings. okay marc@ --- lib/libpthread/uthread/pthread_private.h | 4 ++-- lib/libpthread/uthread/uthread_cancel.c | 8 +++----- lib/libpthread/uthread/uthread_cond.c | 6 +++--- lib/libpthread/uthread/uthread_mutex.c | 4 ++-- lib/libpthread/uthread/uthread_suspend_np.c | 8 +++----- 5 files changed, 13 insertions(+), 17 deletions(-) (limited to 'lib') diff --git a/lib/libpthread/uthread/pthread_private.h b/lib/libpthread/uthread/pthread_private.h index 15dedb454ca..21e2431b330 100644 --- a/lib/libpthread/uthread/pthread_private.h +++ b/lib/libpthread/uthread/pthread_private.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pthread_private.h,v 1.62 2007/04/27 18:04:08 kurt Exp $ */ +/* $OpenBSD: pthread_private.h,v 1.63 2007/04/27 19:40:08 kurt Exp $ */ /* * Copyright (c) 1995-1998 John Birrell . * All rights reserved. @@ -581,7 +581,7 @@ struct stack { * Define a continuation routine that can be used to perform a * transfer of control: */ -typedef void (*thread_continuation_t) (void *); +typedef void (*thread_continuation_t) (struct pthread *); typedef V_TAILQ_ENTRY(pthread) pthread_entry_t; diff --git a/lib/libpthread/uthread/uthread_cancel.c b/lib/libpthread/uthread/uthread_cancel.c index c5eb358aff9..560e034527b 100644 --- a/lib/libpthread/uthread/uthread_cancel.c +++ b/lib/libpthread/uthread/uthread_cancel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_cancel.c,v 1.14 2005/12/21 01:40:23 millert Exp $ */ +/* $OpenBSD: uthread_cancel.c,v 1.15 2007/04/27 19:40:08 kurt Exp $ */ /* * David Leonard , 1999. Public domain. */ @@ -6,7 +6,7 @@ #include #include "pthread_private.h" -static void finish_cancellation(void *arg); +static void finish_cancellation(struct pthread *arg); int pthread_cancel(pthread_t pthread) @@ -228,10 +228,8 @@ _thread_leave_cancellation_point(void) } static void -finish_cancellation(void *arg) +finish_cancellation(struct pthread *curthread) { - struct pthread *curthread = _get_curthread(); - curthread->continuation = NULL; curthread->interrupted = 0; diff --git a/lib/libpthread/uthread/uthread_cond.c b/lib/libpthread/uthread/uthread_cond.c index a8cc4923c36..8e21247d5fc 100644 --- a/lib/libpthread/uthread/uthread_cond.c +++ b/lib/libpthread/uthread/uthread_cond.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_cond.c,v 1.14 2003/12/23 19:31:05 brad Exp $ */ +/* $OpenBSD: uthread_cond.c,v 1.15 2007/04/27 19:40:08 kurt Exp $ */ /* * Copyright (c) 1995 John Birrell . * All rights reserved. @@ -314,7 +314,7 @@ pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex) } if ((interrupted != 0) && (curthread->continuation != NULL)) - curthread->continuation((void *) curthread); + curthread->continuation(curthread); } while ((done == 0) && (rval == 0)); /* No longer in a cancellation point: */ @@ -494,7 +494,7 @@ pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, } if ((interrupted != 0) && (curthread->continuation != NULL)) - curthread->continuation((void *) curthread); + curthread->continuation(curthread); } while ((done == 0) && (rval == 0)); /* No longer in a cancellation point: */ diff --git a/lib/libpthread/uthread/uthread_mutex.c b/lib/libpthread/uthread/uthread_mutex.c index 748c6ffd2eb..362ba9cc13d 100644 --- a/lib/libpthread/uthread/uthread_mutex.c +++ b/lib/libpthread/uthread/uthread_mutex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_mutex.c,v 1.18 2005/10/31 20:48:31 brad Exp $ */ +/* $OpenBSD: uthread_mutex.c,v 1.19 2007/04/27 19:40:08 kurt Exp $ */ /* * Copyright (c) 1995 John Birrell . * All rights reserved. @@ -648,7 +648,7 @@ mutex_lock_common(pthread_mutex_t * mutex) if (curthread->interrupted != 0 && curthread->continuation != NULL) - curthread->continuation((void *) curthread); + curthread->continuation(curthread); /* Return the completion status: */ return (ret); diff --git a/lib/libpthread/uthread/uthread_suspend_np.c b/lib/libpthread/uthread/uthread_suspend_np.c index 2caca0030df..8f3fa261232 100644 --- a/lib/libpthread/uthread/uthread_suspend_np.c +++ b/lib/libpthread/uthread/uthread_suspend_np.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_suspend_np.c,v 1.9 2004/09/18 19:57:35 marc Exp $ */ +/* $OpenBSD: uthread_suspend_np.c,v 1.10 2007/04/27 19:40:08 kurt Exp $ */ /* * Copyright (c) 1995-1998 John Birrell . * All rights reserved. @@ -38,7 +38,7 @@ #include "pthread_private.h" static void suspend_common(struct pthread *thread); -static void finish_suspension(void *arg); +static void finish_suspension(struct pthread *); /* Suspend a thread: */ int @@ -195,10 +195,8 @@ suspend_common(struct pthread *thread) } static void -finish_suspension(void *arg) +finish_suspension(struct pthread *curthread) { - struct pthread *curthread = _get_curthread(); - if (curthread->suspended != SUSP_NO) _thread_kern_sched_state(PS_SUSPENDED, __FILE__, __LINE__); } -- cgit v1.2.3